Created and implemented GameData::Type

This commit is contained in:
Maruno17
2020-12-12 21:26:46 +00:00
parent c8790bafc9
commit bc13517cb7
50 changed files with 698 additions and 784 deletions

View File

@@ -384,7 +384,7 @@ class FightMenuDisplay < BattleMenuBase
def refreshMoveData(move)
# Write PP and type of the selected move
if !USE_GRAPHICS
moveType = PBTypes.getName(move.type)
moveType = GameData::Type.get(move.type).name
if move.total_pp<=0
@msgBox.text = _INTL("PP: ---<br>TYPE/{1}",moveType)
else
@@ -400,7 +400,8 @@ class FightMenuDisplay < BattleMenuBase
end
@visibility["typeIcon"] = true
# Type icon
@typeIcon.src_rect.y = move.type*TYPE_ICON_HEIGHT
type_number = GameData::Type.get(move.type).id_number
@typeIcon.src_rect.y = type_number * TYPE_ICON_HEIGHT
# PP text
if move.total_pp>0
ppFraction = [(4.0*move.pp/move.total_pp).ceil,3].min

View File

@@ -4,7 +4,7 @@ class PokeBattle_Scene
# Return values: -1=Cancel, 0=Fight, 1=Bag, 2=Pokémon, 3=Run, 4=Call
#=============================================================================
def pbCommandMenu(idxBattler,firstAction)
shadowTrainer = (hasConst?(PBTypes,:SHADOW) && @battle.trainerBattle?)
shadowTrainer = (GameData::Type.exists?(:SHADOW) && @battle.trainerBattle?)
cmds = [
_INTL("What will\n{1} do?",@battle.battlers[idxBattler].name),
_INTL("Fight"),

View File

@@ -437,20 +437,17 @@ class PokeBattle_Scene
:DARK => [:PURSUIT, :DARKPULSE, :HONECLAWS, nil, :SNARL, :EMBARGO],
:FAIRY => [:TACKLE, :FAIRYWIND, :MOONLIGHT, nil, :SWIFT, :SWEETKISS]
}
typeDefaultAnim.each do |type, anims|
next if !isConst?(moveType, PBTypes, type)
if typeDefaultAnim[moveType]
anims = typeDefaultAnim[moveType]
if GameData::Move.exists?(anims[moveKind])
anim = pbFindMoveAnimDetails(move2anim, anims[moveKind], idxUser)
end
break if anim
if moveKind >= 3 && GameData::Move.exists?(anims[moveKind - 3])
if !anim && moveKind >= 3 && GameData::Move.exists?(anims[moveKind - 3])
anim = pbFindMoveAnimDetails(move2anim, anims[moveKind - 3], idxUser)
end
break if anim
if GameData::Move.exists?(anims[2])
if !anim && GameData::Move.exists?(anims[2])
anim = pbFindMoveAnimDetails(move2anim, anims[2], idxUser)
end
break
end
return anim if anim
# Default animation for the move's type not found, use Tackle's animation