mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Misc tidying
This commit is contained in:
@@ -53,26 +53,26 @@ module GameData
|
||||
|
||||
def self.editor_properties
|
||||
return [
|
||||
["Outdoor", BooleanProperty, _INTL("If true, this map is an outdoor map and will be tinted according to time of day.")],
|
||||
["ShowArea", BooleanProperty, _INTL("If true, the game will display the map's name upon entry.")],
|
||||
["Bicycle", BooleanProperty, _INTL("If true, the bicycle can be used on this map.")],
|
||||
["BicycleAlways", BooleanProperty, _INTL("If true, the bicycle will be mounted automatically on this map and cannot be dismounted.")],
|
||||
["HealingSpot", MapCoordsProperty, _INTL("Map ID of this Pokémon Center's town, and X and Y coordinates of its entrance within that town.")],
|
||||
["Weather", WeatherEffectProperty, _INTL("Weather conditions in effect for this map.")],
|
||||
["MapPosition", RegionMapCoordsProperty, _INTL("Identifies the point on the regional map for this map.")],
|
||||
["DiveMap", MapProperty, _INTL("Specifies the underwater layer of this map. Use only if this map has deep water.")],
|
||||
["DarkMap", BooleanProperty, _INTL("If true, this map is dark and a circle of light appears around the player. Flash can be used to expand the circle.")],
|
||||
["SafariMap", BooleanProperty, _INTL("If true, this map is part of the Safari Zone (both indoor and outdoor). Not to be used in the reception desk.")],
|
||||
["SnapEdges", BooleanProperty, _INTL("If true, when the player goes near this map's edge, the game doesn't center the player as usual.")],
|
||||
["Dungeon", BooleanProperty, _INTL("If true, this map has a randomly generated layout. See the wiki for more information.")],
|
||||
["BattleBack", StringProperty, _INTL("PNG files named 'XXX_bg', 'XXX_base0', 'XXX_base1', 'XXX_message' in Battlebacks folder, where XXX is this property's value.")],
|
||||
["WildBattleBGM", BGMProperty, _INTL("Default BGM for wild Pokémon battles on this map.")],
|
||||
["TrainerBattleBGM", BGMProperty, _INTL("Default BGM for trainer battles on this map.")],
|
||||
["WildVictoryME", MEProperty, _INTL("Default ME played after winning a wild Pokémon battle on this map.")],
|
||||
["TrainerVictoryME", MEProperty, _INTL("Default ME played after winning a Trainer battle on this map.")],
|
||||
["WildCaptureME", MEProperty, _INTL("Default ME played after catching a wild Pokémon on this map.")],
|
||||
["MapSize", MapSizeProperty, _INTL("The width of the map in Town Map squares, and a string indicating which squares are part of this map.")],
|
||||
["Environment", EnvironmentProperty, _INTL("The default battle environment for battles on this map.")]
|
||||
["Outdoor", BooleanProperty, _INTL("If true, this map is an outdoor map and will be tinted according to time of day.")],
|
||||
["ShowArea", BooleanProperty, _INTL("If true, the game will display the map's name upon entry.")],
|
||||
["Bicycle", BooleanProperty, _INTL("If true, the bicycle can be used on this map.")],
|
||||
["BicycleAlways", BooleanProperty, _INTL("If true, the bicycle will be mounted automatically on this map and cannot be dismounted.")],
|
||||
["HealingSpot", MapCoordsProperty, _INTL("Map ID of this Pokémon Center's town, and X and Y coordinates of its entrance within that town.")],
|
||||
["Weather", WeatherEffectProperty, _INTL("Weather conditions in effect for this map.")],
|
||||
["MapPosition", RegionMapCoordsProperty, _INTL("Identifies the point on the regional map for this map.")],
|
||||
["DiveMap", MapProperty, _INTL("Specifies the underwater layer of this map. Use only if this map has deep water.")],
|
||||
["DarkMap", BooleanProperty, _INTL("If true, this map is dark and a circle of light appears around the player. Flash can be used to expand the circle.")],
|
||||
["SafariMap", BooleanProperty, _INTL("If true, this map is part of the Safari Zone (both indoor and outdoor). Not to be used in the reception desk.")],
|
||||
["SnapEdges", BooleanProperty, _INTL("If true, when the player goes near this map's edge, the game doesn't center the player as usual.")],
|
||||
["Dungeon", BooleanProperty, _INTL("If true, this map has a randomly generated layout. See the wiki for more information.")],
|
||||
["BattleBack", StringProperty, _INTL("PNG files named 'XXX_bg', 'XXX_base0', 'XXX_base1', 'XXX_message' in Battlebacks folder, where XXX is this property's value.")],
|
||||
["WildBattleBGM", BGMProperty, _INTL("Default BGM for wild Pokémon battles on this map.")],
|
||||
["TrainerBattleBGM", BGMProperty, _INTL("Default BGM for trainer battles on this map.")],
|
||||
["WildVictoryME", MEProperty, _INTL("Default ME played after winning a wild Pokémon battle on this map.")],
|
||||
["TrainerVictoryME", MEProperty, _INTL("Default ME played after winning a Trainer battle on this map.")],
|
||||
["WildCaptureME", MEProperty, _INTL("Default ME played after catching a wild Pokémon on this map.")],
|
||||
["MapSize", MapSizeProperty, _INTL("The width of the map in Town Map squares, and a string indicating which squares are part of this map.")],
|
||||
["Environment", EnumProperty2.new(PBEnvironment), _INTL("The default battle environment for battles on this map.")]
|
||||
]
|
||||
end
|
||||
|
||||
|
||||
83
Data/Scripts/011_Data/004_PBTypes.rb
Normal file
83
Data/Scripts/011_Data/004_PBTypes.rb
Normal file
@@ -0,0 +1,83 @@
|
||||
module PBTypeEffectiveness
|
||||
INEFFECTIVE = 0
|
||||
NOT_EFFECTIVE_ONE = 1
|
||||
NORMAL_EFFECTIVE_ONE = 2
|
||||
SUPER_EFFECTIVE_ONE = 4
|
||||
NORMAL_EFFECTIVE = NORMAL_EFFECTIVE_ONE ** 3
|
||||
|
||||
def self.ineffective?(value)
|
||||
return value == INEFFECTIVE
|
||||
end
|
||||
|
||||
def self.notVeryEffective?(value)
|
||||
return value > INEFFECTIVE && value < NORMAL_EFFECTIVE
|
||||
end
|
||||
|
||||
def self.resistant?(value)
|
||||
return value < NORMAL_EFFECTIVE
|
||||
end
|
||||
|
||||
def self.normalEffective?(value)
|
||||
return value == NORMAL_EFFECTIVE
|
||||
end
|
||||
|
||||
def self.superEffective?(value)
|
||||
return value > NORMAL_EFFECTIVE
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
module PBTypes
|
||||
def self.regularTypesCount
|
||||
ret = 0
|
||||
GameData::Type.each { |t| ret += 1 if !t.pseudo_type && t.id != :SHADOW }
|
||||
return ret
|
||||
end
|
||||
|
||||
def self.isPhysicalType?(type); return GameData::Type.get(type).physical?; end
|
||||
def self.isSpecialType?(type); return GameData::Type.get(type).special?; end
|
||||
def self.isPseudoType?(type); return GameData::Type.get(type).pseudo_type; end
|
||||
|
||||
def self.getEffectiveness(attack_type, target_type)
|
||||
return GameData::Type.get(target_type).effectiveness(attack_type)
|
||||
end
|
||||
|
||||
def self.getCombinedEffectiveness(attack_type, target_type1, target_type2 = nil, target_type3 = nil)
|
||||
mod1 = self.getEffectiveness(attack_type, target_type1)
|
||||
mod2 = PBTypeEffectiveness::NORMAL_EFFECTIVE_ONE
|
||||
mod3 = PBTypeEffectiveness::NORMAL_EFFECTIVE_ONE
|
||||
if target_type2 && target_type1 != target_type2
|
||||
mod2 = self.getEffectiveness(attack_type, target_type2)
|
||||
end
|
||||
if target_type3 && target_type1 != target_type3 && target_type2 != target_type3
|
||||
mod3 = self.getEffectiveness(attack_type, target_type3)
|
||||
end
|
||||
return mod1 * mod2 * mod3
|
||||
end
|
||||
|
||||
def self.ineffective?(attack_type, target_type1, target_type2 = nil, target_type3 = nil)
|
||||
value = self.getCombinedEffectiveness(attack_type, target_type1, target_type2, target_type3)
|
||||
return PBTypeEffectiveness.ineffective?(value)
|
||||
end
|
||||
|
||||
def self.notVeryEffective?(attack_type, target_type1, target_type2 = nil, target_type3 = nil)
|
||||
value = self.getCombinedEffectiveness(attack_type, target_type1, target_type2, target_type3)
|
||||
return PBTypeEffectiveness.notVeryEffective?(value)
|
||||
end
|
||||
|
||||
def self.resistant?(attack_type, target_type1, target_type2 = nil, target_type3 = nil)
|
||||
value = self.getCombinedEffectiveness(attack_type, target_type1, target_type2, target_type3)
|
||||
return PBTypeEffectiveness.resistant?(value)
|
||||
end
|
||||
|
||||
def self.normalEffective?(attack_type, target_type1, target_type2 = nil, target_type3 = nil)
|
||||
value = self.getCombinedEffectiveness(attack_type, target_type1, target_type2, target_type3)
|
||||
return PBTypeEffectiveness.normalEffective?(value)
|
||||
end
|
||||
|
||||
def self.superEffective?(attack_type, target_type1, target_type2 = nil, target_type3 = nil)
|
||||
value = self.getCombinedEffectiveness(attack_type, target_type1, target_type2, target_type3)
|
||||
return PBTypeEffectiveness.superEffective?(value)
|
||||
end
|
||||
end
|
||||
@@ -1,83 +0,0 @@
|
||||
module PBTypeEffectiveness
|
||||
INEFFECTIVE = 0
|
||||
NOT_EFFECTIVE_ONE = 1
|
||||
NORMAL_EFFECTIVE_ONE = 2
|
||||
SUPER_EFFECTIVE_ONE = 4
|
||||
NORMAL_EFFECTIVE = NORMAL_EFFECTIVE_ONE ** 3
|
||||
|
||||
def self.ineffective?(value)
|
||||
return value == INEFFECTIVE
|
||||
end
|
||||
|
||||
def self.notVeryEffective?(value)
|
||||
return value > INEFFECTIVE && value < NORMAL_EFFECTIVE
|
||||
end
|
||||
|
||||
def self.resistant?(value)
|
||||
return value < NORMAL_EFFECTIVE
|
||||
end
|
||||
|
||||
def self.normalEffective?(value)
|
||||
return value == NORMAL_EFFECTIVE
|
||||
end
|
||||
|
||||
def self.superEffective?(value)
|
||||
return value > NORMAL_EFFECTIVE
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
class PBTypes
|
||||
def PBTypes.regularTypesCount
|
||||
ret = 0
|
||||
GameData::Type.each { |t| ret += 1 if !t.pseudo_type && t.id != :SHADOW }
|
||||
return ret
|
||||
end
|
||||
|
||||
def PBTypes.isPhysicalType?(type); return GameData::Type.get(type).physical?; end
|
||||
def PBTypes.isSpecialType?(type); return GameData::Type.get(type).special?; end
|
||||
def PBTypes.isPseudoType?(type); return GameData::Type.get(type).pseudo_type; end
|
||||
|
||||
def PBTypes.getEffectiveness(attack_type, target_type)
|
||||
return GameData::Type.get(target_type).effectiveness(attack_type)
|
||||
end
|
||||
|
||||
def PBTypes.getCombinedEffectiveness(attack_type, target_type1, target_type2 = nil, target_type3 = nil)
|
||||
mod1 = PBTypes.getEffectiveness(attack_type, target_type1)
|
||||
mod2 = PBTypeEffectiveness::NORMAL_EFFECTIVE_ONE
|
||||
mod3 = PBTypeEffectiveness::NORMAL_EFFECTIVE_ONE
|
||||
if target_type2 && target_type1 != target_type2
|
||||
mod2 = PBTypes.getEffectiveness(attack_type, target_type2)
|
||||
end
|
||||
if target_type3 && target_type1 != target_type3 && target_type2 != target_type3
|
||||
mod3 = PBTypes.getEffectiveness(attack_type, target_type3)
|
||||
end
|
||||
return mod1 * mod2 * mod3
|
||||
end
|
||||
|
||||
def PBTypes.ineffective?(attack_type, target_type1, target_type2 = nil, target_type3 = nil)
|
||||
value = PBTypes.getCombinedEffectiveness(attack_type, target_type1, target_type2, target_type3)
|
||||
return PBTypeEffectiveness.ineffective?(value)
|
||||
end
|
||||
|
||||
def PBTypes.notVeryEffective?(attack_type, target_type1, target_type2 = nil, target_type3 = nil)
|
||||
value = PBTypes.getCombinedEffectiveness(attack_type, target_type1, target_type2, target_type3)
|
||||
return PBTypeEffectiveness.notVeryEffective?(value)
|
||||
end
|
||||
|
||||
def PBTypes.resistant?(attack_type, target_type1, target_type2 = nil, target_type3 = nil)
|
||||
value = PBTypes.getCombinedEffectiveness(attack_type, target_type1, target_type2, target_type3)
|
||||
return PBTypeEffectiveness.resistant?(value)
|
||||
end
|
||||
|
||||
def PBTypes.normalEffective?(attack_type, target_type1, target_type2 = nil, target_type3 = nil)
|
||||
value = PBTypes.getCombinedEffectiveness(attack_type, target_type1, target_type2, target_type3)
|
||||
return PBTypeEffectiveness.normalEffective?(value)
|
||||
end
|
||||
|
||||
def PBTypes.superEffective?(attack_type, target_type1, target_type2 = nil, target_type3 = nil)
|
||||
value = PBTypes.getCombinedEffectiveness(attack_type, target_type1, target_type2, target_type3)
|
||||
return PBTypeEffectiveness.superEffective?(value)
|
||||
end
|
||||
end
|
||||
@@ -26,10 +26,9 @@ module PBNatures
|
||||
QUIRKY = 24
|
||||
|
||||
def self.maxValue; 24; end
|
||||
def self.getCount; 25; end
|
||||
|
||||
def self.getName(id)
|
||||
id = getID(PBNatures,id)
|
||||
id = getID(PBNatures, id)
|
||||
names = [
|
||||
_INTL("Hardy"),
|
||||
_INTL("Lonely"),
|
||||
@@ -61,15 +60,17 @@ module PBNatures
|
||||
end
|
||||
|
||||
def self.getStatRaised(id)
|
||||
m = (id%25)/5 # 25 here is (number of stats)**2, not PBNatures.getCount
|
||||
return [PBStats::ATTACK,PBStats::DEFENSE,PBStats::SPEED,
|
||||
PBStats::SPATK,PBStats::SPDEF][m]
|
||||
stats = [PBStats::ATTACK, PBStats::DEFENSE, PBStats::SPEED,
|
||||
PBStats::SPATK, PBStats::SPDEF]
|
||||
m = (id % (stats.length ** 2)) / stats.length
|
||||
return stats[m]
|
||||
end
|
||||
|
||||
def self.getStatLowered(id)
|
||||
m = id%5 # Don't need to %25 here because 25 is a multiple of 5
|
||||
return [PBStats::ATTACK,PBStats::DEFENSE,PBStats::SPEED,
|
||||
PBStats::SPATK,PBStats::SPDEF][m]
|
||||
stats = [PBStats::ATTACK, PBStats::DEFENSE, PBStats::SPEED,
|
||||
PBStats::SPATK, PBStats::SPDEF]
|
||||
m = id % stats.length
|
||||
return stats[m]
|
||||
end
|
||||
|
||||
def self.getStatChanges(id)
|
||||
|
||||
@@ -8,6 +8,8 @@ module PBGenderRates
|
||||
FemaleSevenEighths = 6
|
||||
AlwaysFemale = 7
|
||||
|
||||
def self.maxValue; return 7; end
|
||||
|
||||
def self.genderByte(gender)
|
||||
case gender
|
||||
when AlwaysMale then return 0
|
||||
|
||||
@@ -16,27 +16,4 @@ module PBEggGroups
|
||||
Dragon = 14
|
||||
|
||||
def self.maxValue; 14; end
|
||||
def self.getCount; 15; end
|
||||
|
||||
def self.getName(id)
|
||||
id = getID(PBEggGroups,id)
|
||||
names = [
|
||||
_INTL("Undiscovered"),
|
||||
_INTL("Monster"),
|
||||
_INTL("Water 1"),
|
||||
_INTL("Bug"),
|
||||
_INTL("Flying"),
|
||||
_INTL("Field"),
|
||||
_INTL("Fairy"),
|
||||
_INTL("Grass"),
|
||||
_INTL("Human-like"),
|
||||
_INTL("Water 3"),
|
||||
_INTL("Mineral"),
|
||||
_INTL("Amorphous"),
|
||||
_INTL("Water 2"),
|
||||
_INTL("Ditto"),
|
||||
_INTL("Dragon")
|
||||
]
|
||||
return names[id]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,8 +11,7 @@ module PBColors
|
||||
White = 8
|
||||
Pink = 9
|
||||
|
||||
def self.maxValue; 9; end
|
||||
def self.getCount; 10; end
|
||||
def self.maxValue; 9; end
|
||||
|
||||
def self.getName(id)
|
||||
id = getID(PBColors,id)
|
||||
|
||||
@@ -10,8 +10,7 @@ module PBHabitats
|
||||
Urban = 8
|
||||
Rare = 9
|
||||
|
||||
def self.maxValue; 9; end
|
||||
def self.getCount; 10; end
|
||||
def self.maxValue; 9; end
|
||||
|
||||
def self.getName(id)
|
||||
id = getID(PBHabitats,id)
|
||||
|
||||
@@ -81,7 +81,6 @@ module PBRibbons
|
||||
WORLDCHAMPION = 80
|
||||
|
||||
def self.maxValue; 80; end
|
||||
def self.getCount; 80; end
|
||||
|
||||
def self.getName(id)
|
||||
id = getID(PBRibbons,id)
|
||||
|
||||
Reference in New Issue
Block a user