Added class GameData::Status

This commit is contained in:
Maruno17
2021-02-15 23:20:51 +00:00
parent 8b5b9d5fc4
commit 6a8e4fcfa5
49 changed files with 468 additions and 430 deletions

View File

@@ -1,93 +0,0 @@
#===============================================================================
# Terrain tags
#===============================================================================
module PBTerrain
Ledge = 1
Grass = 2
Sand = 3
Rock = 4
DeepWater = 5
StillWater = 6
Water = 7
Waterfall = 8
WaterfallCrest = 9
TallGrass = 10
UnderwaterGrass = 11
Ice = 12
Neutral = 13
SootGrass = 14
Bridge = 15
Puddle = 16
def self.isSurfable?(tag)
return PBTerrain.isWater?(tag)
end
def self.isWater?(tag)
return tag==PBTerrain::Water ||
tag==PBTerrain::StillWater ||
tag==PBTerrain::DeepWater ||
tag==PBTerrain::WaterfallCrest ||
tag==PBTerrain::Waterfall
end
def self.isPassableWater?(tag)
return tag==PBTerrain::Water ||
tag==PBTerrain::StillWater ||
tag==PBTerrain::DeepWater ||
tag==PBTerrain::WaterfallCrest
end
def self.isJustWater?(tag)
return tag==PBTerrain::Water ||
tag==PBTerrain::StillWater ||
tag==PBTerrain::DeepWater
end
def self.isDeepWater?(tag)
return tag==PBTerrain::DeepWater
end
def self.isWaterfall?(tag)
return tag==PBTerrain::WaterfallCrest ||
tag==PBTerrain::Waterfall
end
def self.isGrass?(tag)
return tag==PBTerrain::Grass ||
tag==PBTerrain::TallGrass ||
tag==PBTerrain::UnderwaterGrass ||
tag==PBTerrain::SootGrass
end
def self.isJustGrass?(tag) # The Poké Radar only works in these tiles
return tag==PBTerrain::Grass ||
tag==PBTerrain::SootGrass
end
def self.isLedge?(tag)
return tag==PBTerrain::Ledge
end
def self.isIce?(tag)
return tag==PBTerrain::Ice
end
def self.isBridge?(tag)
return tag==PBTerrain::Bridge
end
def self.hasReflections?(tag)
return tag==PBTerrain::StillWater ||
tag==PBTerrain::Puddle
end
def self.onlyWalk?(tag)
return tag==PBTerrain::TallGrass ||
tag==PBTerrain::Ice
end
def self.isDoubleWildBattle?(tag)
return tag==PBTerrain::TallGrass
end
end

View File

@@ -277,19 +277,19 @@ Events.onStepTakenTransferPossible += proc { |_sender,e|
if $PokemonGlobal.stepcount%4==0 && Settings::POISON_IN_FIELD
flashed = false
for i in $Trainer.able_party
if i.status==PBStatuses::POISON && !i.hasAbility?(:IMMUNITY)
if i.status == :POISON && !i.hasAbility?(:IMMUNITY)
if !flashed
$game_screen.start_flash(Color.new(255,0,0,128), 4)
flashed = true
end
i.hp -= 1 if i.hp>1 || Settings::POISON_FAINT_IN_FIELD
if i.hp==1 && !Settings::POISON_FAINT_IN_FIELD
i.status = PBStatuses::NONE
i.status = :NONE
pbMessage(_INTL("{1} survived the poisoning.\\nThe poison faded away!\1",i.name))
next
elsif i.hp==0
i.changeHappiness("faint")
i.status = PBStatuses::NONE
i.status = :NONE
pbMessage(_INTL("{1} fainted...",i.name))
end
if $Trainer.able_pokemon_count == 0
@@ -373,7 +373,8 @@ end
# Start wild encounters while turning on the spot
Events.onChangeDirection += proc {
pbBattleOnStepTaken if !$game_temp.in_menu
repel_active = ($PokemonGlobal.repel > 0)
pbBattleOnStepTaken(repel_active) if !$game_temp.in_menu
}
def pbBattleOnStepTaken(repel_active)

View File

@@ -1,25 +1,3 @@
begin
module PBFieldWeather
None = 0 # None must be 0 (preset RMXP weather)
Rain = 1 # Rain must be 1 (preset RMXP weather)
Storm = 2 # Storm must be 2 (preset RMXP weather)
Snow = 3 # Snow must be 3 (preset RMXP weather)
Blizzard = 4
Sandstorm = 5
HeavyRain = 6
Sun = Sunny = 7
def PBFieldWeather.maxValue; return 7; end
end
rescue Exception
if $!.is_a?(SystemExit) || "#{$!.class}"=="Reset"
raise $!
end
end
module RPG
class Weather
attr_reader :type

View File

@@ -554,7 +554,7 @@ end
#===============================================================================
def pbAfterBattle(decision,canLose)
$Trainer.party.each do |pkmn|
pkmn.statusCount = 0 if pkmn.status==PBStatuses::POISON # Bad poison becomes regular
pkmn.statusCount = 0 if pkmn.status == :POISON # Bad poison becomes regular
pkmn.makeUnmega
pkmn.makeUnprimal
end

View File

@@ -1,100 +1,3 @@
module EncounterTypes
Land = 0
LandDay = 1
LandNight = 2
LandMorning = 3
LandAfternoon = 4
LandEvening = 5
Cave = 6
CaveDay = 7
CaveNight = 8
CaveMorning = 9
CaveAfternoon = 10
CaveEvening = 11
Water = 12
WaterDay = 13
WaterNight = 14
WaterMorning = 15
WaterAfternoon = 16
WaterEvening = 17
OldRod = 18
GoodRod = 19
SuperRod = 20
RockSmash = 21
HeadbuttLow = 22
HeadbuttHigh = 23
BugContest = 24
Names = [
"Land", "LandDay", "LandNight", "LandMorning", "LandAfternoon", "LandEvening",
"Cave", "CaveDay", "CaveNight", "CaveMorning", "CaveAfternoon", "CaveEvening",
"Water", "WaterDay", "WaterNight", "WaterMorning", "WaterAfternoon", "WaterEvening",
"OldRod", "GoodRod", "SuperRod", "RockSmash", "HeadbuttLow", "HeadbuttHigh",
"BugContest"
]
Probabilities = [
[20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1],
[20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1],
[20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1],
[20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1],
[20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1],
[20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1],
[20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1],
[20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1],
[20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1],
[20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1],
[20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1],
[20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1],
[60, 30, 5, 4, 1],
[60, 30, 5, 4, 1],
[60, 30, 5, 4, 1],
[60, 30, 5, 4, 1],
[60, 30, 5, 4, 1],
[60, 30, 5, 4, 1],
[70, 30],
[60, 20, 20],
[40, 40, 15, 4, 1],
[60, 30, 5, 4, 1],
[30, 25, 20, 10, 5, 5, 4, 1],
[30, 25, 20, 10, 5, 5, 4, 1],
[20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
]
Chances_Per_Step = [
25, 25, 25, 25, 25, 25, # Lands
10, 10, 10, 10, 10, 10, # Caves
10, 10, 10, 10, 10, 10, # Waters
0, 0, 0, 0, 0, 0, 25
]
Kinds = [
1, 1, 1, 1, 1, 1, # Lands
2, 2, 2, 2, 2, 2, # Caves
3, 3, 3, 3, 3, 3, # Waters
0, 0, 0, 0, 0, 0, 1
]
def self.is_land_type?(enc_type)
return self.is_normal_land_type?(enc_type) || enc_type == BugContest
end
def self.is_normal_land_type?(enc_type)
return [Land, LandDay, LandNight, LandMorning, LandAfternoon, LandEvening].include?(enc_type)
end
def self.is_cave_type?(enc_type)
return [Cave, CaveDay, CaveNight, CaveMorning, CaveAfternoon, CaveEvening].include?(enc_type)
end
def self.is_water_type?(enc_type)
return [Water, WaterDay, WaterNight, WaterMorning, WaterAfternoon, WaterEvening].include?(enc_type)
end
def self.is_fishing_type?(enc_type)
return [OldRod, GoodRod, SuperRod].include?(enc_type)
end
end
#===============================================================================
#
#===============================================================================