mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 21:54:58 +00:00
update to latest 6.0 release
This commit is contained in:
@@ -104,6 +104,11 @@ class LightEffect
|
||||
@disposed = false
|
||||
end
|
||||
|
||||
def opacity=(value)
|
||||
@light.opacity=value
|
||||
update
|
||||
end
|
||||
|
||||
def disposed?
|
||||
return @disposed
|
||||
end
|
||||
@@ -161,6 +166,31 @@ class LightEffect_Basic < LightEffect
|
||||
end
|
||||
end
|
||||
|
||||
class LightEffect_GlowPlant < LightEffect
|
||||
def update
|
||||
return if !darknessEffectOnCurrentMap()
|
||||
mt_moon_direction = getMtMoonDirection()
|
||||
#return if $game_player.direction != mt_moon_direction
|
||||
return if !@light || !@event
|
||||
super
|
||||
@light.opacity = $game_player.direction == mt_moon_direction ? 100 : 0
|
||||
@light.opacity = 150 if isInMtMoon()
|
||||
@light.ox = 32
|
||||
@light.oy = 48
|
||||
if (Object.const_defined?(:ScreenPosHelper) rescue false)
|
||||
@light.x = ScreenPosHelper.pbScreenX(@event)
|
||||
@light.y = ScreenPosHelper.pbScreenY(@event)
|
||||
@light.zoom_x = ScreenPosHelper.pbScreenZoomX(@event)
|
||||
else
|
||||
@light.x = @event.screen_x
|
||||
@light.y = @event.screen_y
|
||||
@light.zoom_x = 1.0
|
||||
end
|
||||
@light.zoom_y = @light.zoom_x
|
||||
@light.tone = $game_screen.tone
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
class LightEffect_DayNight < LightEffect
|
||||
|
||||
@@ -204,11 +204,9 @@ def isFusedEncounter
|
||||
return (rand(chance) == 0)
|
||||
end
|
||||
|
||||
|
||||
|
||||
def getEncounter(encounter_type)
|
||||
encounter = $PokemonEncounters.choose_wild_pokemon(encounter_type)
|
||||
if $game_switches[SWITCH_RANDOM_WILD] #wild poke random activated
|
||||
if $game_switches[SWITCH_RANDOM_WILD] #wild poke random activated
|
||||
if $game_switches[SWITCH_WILD_RANDOM_GLOBAL] && encounter != nil
|
||||
encounter[0] = getRandomizedTo(encounter[0])
|
||||
end
|
||||
@@ -273,8 +271,6 @@ Events.onMapChanging += proc { |_sender, e|
|
||||
$game_screen.weather(:None, 0, 0)
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Set up various data related to the new map
|
||||
Events.onMapChange += proc { |_sender, e|
|
||||
old_map_ID = e[0] # previous map ID, is 0 if no map ID
|
||||
@@ -287,10 +283,10 @@ Events.onMapChange += proc { |_sender, e|
|
||||
$PokemonGlobal.visitedMaps[$game_map.map_id] = true
|
||||
next if old_map_ID == 0 || old_map_ID == $game_map.map_id
|
||||
|
||||
if !new_map_metadata || !new_map_metadata.weather
|
||||
$game_screen.weather(:None, 0, 0)
|
||||
next
|
||||
end
|
||||
if !new_map_metadata || !new_map_metadata.weather
|
||||
$game_screen.weather(:None, 0, 0)
|
||||
next
|
||||
end
|
||||
map_infos = pbLoadMapInfos
|
||||
if $game_map.name == map_infos[old_map_ID].name
|
||||
old_map_metadata = GameData::MapMetadata.try_get(old_map_ID)
|
||||
@@ -318,7 +314,6 @@ Events.onMapChange += proc { |_sender, e|
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
Events.onMapSceneChange += proc { |_sender, e|
|
||||
scene = e[0]
|
||||
mapChanged = e[1]
|
||||
@@ -333,7 +328,7 @@ Events.onMapSceneChange += proc { |_sender, e|
|
||||
end
|
||||
# Display darkness circle on dark maps
|
||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
||||
if map_metadata && map_metadata.dark_map
|
||||
if map_metadata && map_metadata.dark_map || (darknessEffectOnCurrentMap())
|
||||
$PokemonTemp.darknessSprite = DarknessSprite.new
|
||||
scene.spriteset.addUserSprite($PokemonTemp.darknessSprite)
|
||||
if $PokemonGlobal.flashUsed
|
||||
@@ -833,7 +828,7 @@ end
|
||||
# Being given an item
|
||||
#===============================================================================
|
||||
|
||||
def pbReceiveItem(item, quantity = 1, item_name = "", music = nil, canRandom=true)
|
||||
def pbReceiveItem(item, quantity = 1, item_name = "", music = nil, canRandom = true)
|
||||
#item_name -> pour donner un autre nom à l'item. Pas encore réimplémenté et surtout là pour éviter que ça plante quand des events essaient de le faire
|
||||
canRandom = false if !$game_switches[SWITCH_RANDOM_ITEMS_GENERAL]
|
||||
original_item = GameData::Item.get(item)
|
||||
@@ -859,8 +854,8 @@ def pbReceiveItem(item, quantity = 1, item_name = "", music = nil, canRandom=tru
|
||||
if item == :LEFTOVERS
|
||||
pbMessage(_INTL("\\me[{1}]You obtained some \\c[1]{2}\\c[0]!\\wtnp[30]", meName, itemname))
|
||||
elsif item.is_machine? # TM or HM
|
||||
if $game_switches[SWITCH_RANDOMIZE_GYMS_SEPARATELY] && $game_switches[SWITCH_RANDOMIZED_GYM_TYPES] && $game_variables[VAR_CURRENT_GYM_TYPE]>-1
|
||||
item=randomizeGymTM(item)
|
||||
if $game_switches[SWITCH_RANDOMIZE_GYMS_SEPARATELY] && $game_switches[SWITCH_RANDOMIZED_GYM_TYPES] && $game_variables[VAR_CURRENT_GYM_TYPE] > -1
|
||||
item = randomizeGymTM(item)
|
||||
end
|
||||
pbMessage(_INTL("\\me[{1}]You obtained \\c[1]{2} {3}\\c[0]!\\wtnp[30]", meName, itemname, GameData::Move.get(move).name))
|
||||
elsif quantity > 1
|
||||
@@ -878,22 +873,18 @@ def pbReceiveItem(item, quantity = 1, item_name = "", music = nil, canRandom=tru
|
||||
return false # Can't add the item
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def randomizeGymTM(old_item)
|
||||
gym_index = pbGet(VAR_CURRENT_GYM_TYPE)
|
||||
type_id = pbGet(VAR_GYM_TYPES_ARRAY)[gym_index]
|
||||
idx=0
|
||||
idx = 0
|
||||
if $Trainer.badge_count >= 3
|
||||
idx=1
|
||||
idx = 1
|
||||
end
|
||||
if $Trainer.badge_count >= 6
|
||||
idx=2
|
||||
idx = 2
|
||||
end
|
||||
if $Trainer.badge_count >= 8
|
||||
idx=3
|
||||
idx = 3
|
||||
end
|
||||
typed_tms_array = Settings::RANDOMIZED_GYM_TYPE_TM[type_id]
|
||||
return old_item if !typed_tms_array
|
||||
|
||||
@@ -174,11 +174,13 @@ def pbPrepareBattle(battle)
|
||||
back = getBattleBackgroundFromMetadata(GameData::MapMetadata.get($game_map.map_id))
|
||||
backdrop = back if back && back != ""
|
||||
end
|
||||
|
||||
if !backdrop
|
||||
isOutdoor = GameData::MapMetadata.get($game_map.map_id).outdoor_map rescue false
|
||||
backdrop = "indoorA" if !isOutdoor
|
||||
backdrop = "Field" if isOutdoor
|
||||
end
|
||||
|
||||
battle.backdrop = backdrop
|
||||
# Choose a name for bases depending on environment
|
||||
if battleRules["base"].nil?
|
||||
|
||||
@@ -39,3 +39,12 @@ Events.onWildPokemonCreate += proc { |_sender, e|
|
||||
# YOUR CODE HERE
|
||||
# end
|
||||
#}
|
||||
|
||||
|
||||
#NECROZMA BATTLE
|
||||
Events.onWildPokemonCreate += proc { |_sender, e|
|
||||
pokemon = e[0]
|
||||
if $game_switches[SWITCH_KANTO_DARKNESS_STAGE_4] && pokemon.species == :NECROZMA
|
||||
pokemon.item = :NECROZIUM
|
||||
end
|
||||
}
|
||||
|
||||
@@ -5,83 +5,86 @@ def pbGetTimeNow
|
||||
return Time.now
|
||||
end
|
||||
|
||||
|
||||
|
||||
module PBDayNight
|
||||
HourlyTones = [
|
||||
Tone.new(-70, -90, 15, 55), # Night # Midnight
|
||||
Tone.new(-70, -90, 15, 55), # Night
|
||||
Tone.new(-70, -90, 15, 55), # Night
|
||||
Tone.new(-70, -90, 15, 55), # Night
|
||||
Tone.new(-60, -70, -5, 50), # Night
|
||||
Tone.new(-40, -50, -35, 50), # Day/morning
|
||||
Tone.new(-40, -50, -35, 50), # Day/morning # 6AM
|
||||
Tone.new(-40, -50, -35, 50), # Day/morning
|
||||
Tone.new(-40, -50, -35, 50), # Day/morning
|
||||
Tone.new(-20, -25, -15, 20), # Day/morning
|
||||
Tone.new( 0, 0, 0, 0), # Day
|
||||
Tone.new( 0, 0, 0, 0), # Day
|
||||
Tone.new( 0, 0, 0, 0), # Day # Noon
|
||||
Tone.new( 0, 0, 0, 0), # Day
|
||||
Tone.new( 0, 0, 0, 0), # Day/afternoon
|
||||
Tone.new( 0, 0, 0, 0), # Day/afternoon
|
||||
Tone.new( 0, 0, 0, 0), # Day/afternoon
|
||||
Tone.new( 0, 0, 0, 0), # Day/afternoon
|
||||
Tone.new( -5, -30, -20, 0), # Day/evening # 6PM
|
||||
Tone.new(-15, -60, -10, 20), # Day/evening
|
||||
Tone.new(-15, -60, -10, 20), # Day/evening
|
||||
Tone.new(-40, -75, 5, 40), # Night
|
||||
Tone.new(-70, -90, 15, 55), # Night
|
||||
Tone.new(-70, -90, 15, 55) # Night
|
||||
Tone.new(-70, -90, 15, 55), # Night # Midnight
|
||||
Tone.new(-70, -90, 15, 55), # Night
|
||||
Tone.new(-70, -90, 15, 55), # Night
|
||||
Tone.new(-70, -90, 15, 55), # Night
|
||||
Tone.new(-60, -70, -5, 50), # Night
|
||||
Tone.new(-40, -50, -35, 50), # Day/morning
|
||||
Tone.new(-40, -50, -35, 50), # Day/morning # 6AM
|
||||
Tone.new(-40, -50, -35, 50), # Day/morning
|
||||
Tone.new(-40, -50, -35, 50), # Day/morning
|
||||
Tone.new(-20, -25, -15, 20), # Day/morning
|
||||
Tone.new(0, 0, 0, 0), # Day
|
||||
Tone.new(0, 0, 0, 0), # Day
|
||||
Tone.new(0, 0, 0, 0), # Day # Noon
|
||||
Tone.new(0, 0, 0, 0), # Day
|
||||
Tone.new(0, 0, 0, 0), # Day/afternoon
|
||||
Tone.new(0, 0, 0, 0), # Day/afternoon
|
||||
Tone.new(0, 0, 0, 0), # Day/afternoon
|
||||
Tone.new(0, 0, 0, 0), # Day/afternoon
|
||||
Tone.new(-5, -30, -20, 0), # Day/evening # 6PM
|
||||
Tone.new(-15, -60, -10, 20), # Day/evening
|
||||
Tone.new(-15, -60, -10, 20), # Day/evening
|
||||
Tone.new(-40, -75, 5, 40), # Night
|
||||
Tone.new(-70, -90, 15, 55), # Night
|
||||
Tone.new(-70, -90, 15, 55) # Night
|
||||
]
|
||||
@cachedTone = nil
|
||||
@dayNightToneLastUpdate = nil
|
||||
@oneOverSixty = 1/60.0
|
||||
@oneOverSixty = 1 / 60.0
|
||||
|
||||
# Returns true if it's day.
|
||||
def self.isDay?(time=nil)
|
||||
def self.isDay?(time = nil)
|
||||
return false if darknessEffectOnCurrentMap()
|
||||
time = pbGetTimeNow if !time
|
||||
return (time.hour>=5 && time.hour<20)
|
||||
return (time.hour >= 5 && time.hour < 20)
|
||||
end
|
||||
|
||||
# Returns true if it's night.
|
||||
def self.isNight?(time=nil)
|
||||
def self.isNight?(time = nil)
|
||||
return true if darknessEffectOnCurrentMap()
|
||||
time = pbGetTimeNow if !time
|
||||
return (time.hour>=20 || time.hour<5)
|
||||
return (time.hour >= 20 || time.hour < 5)
|
||||
end
|
||||
|
||||
# Returns true if it's morning.
|
||||
def self.isMorning?(time=nil)
|
||||
def self.isMorning?(time = nil)
|
||||
return false if darknessEffectOnCurrentMap()
|
||||
time = pbGetTimeNow if !time
|
||||
return (time.hour>=5 && time.hour<10)
|
||||
return (time.hour >= 5 && time.hour < 10)
|
||||
end
|
||||
|
||||
# Returns true if it's the afternoon.
|
||||
def self.isAfternoon?(time=nil)
|
||||
def self.isAfternoon?(time = nil)
|
||||
return false if darknessEffectOnCurrentMap()
|
||||
time = pbGetTimeNow if !time
|
||||
return (time.hour>=14 && time.hour<17)
|
||||
return (time.hour >= 14 && time.hour < 17)
|
||||
end
|
||||
|
||||
# Returns true if it's the evening.
|
||||
def self.isEvening?(time=nil)
|
||||
def self.isEvening?(time = nil)
|
||||
return false if darknessEffectOnCurrentMap()
|
||||
time = pbGetTimeNow if !time
|
||||
return (time.hour>=17 && time.hour<20)
|
||||
return (time.hour >= 17 && time.hour < 20)
|
||||
end
|
||||
|
||||
# Gets a number representing the amount of daylight (0=full night, 255=full day).
|
||||
def self.getShade
|
||||
time = pbGetDayNightMinutes
|
||||
time = (24*60)-time if time>(12*60)
|
||||
return 255*time/(12*60)
|
||||
time = (24 * 60) - time if time > (12 * 60)
|
||||
return 255 * time / (12 * 60)
|
||||
end
|
||||
|
||||
# Gets a Tone object representing a suggested shading
|
||||
# tone for the current time of day.
|
||||
def self.getTone
|
||||
@cachedTone = Tone.new(0,0,0) if !@cachedTone
|
||||
@cachedTone = Tone.new(0, 0, 0) if !@cachedTone
|
||||
return @cachedTone if !Settings::TIME_SHADING
|
||||
if !@dayNightToneLastUpdate ||
|
||||
Graphics.frame_count-@dayNightToneLastUpdate>=Graphics.frame_rate*30
|
||||
Graphics.frame_count - @dayNightToneLastUpdate >= Graphics.frame_rate * 30
|
||||
getToneInternal
|
||||
@dayNightToneLastUpdate = Graphics.frame_count
|
||||
end
|
||||
@@ -89,8 +92,9 @@ module PBDayNight
|
||||
end
|
||||
|
||||
def self.pbGetDayNightMinutes
|
||||
now = pbGetTimeNow # Get the current in-game time
|
||||
return (now.hour*60)+now.min
|
||||
return 0 if darknessEffectOnCurrentMap() #midnight
|
||||
now = pbGetTimeNow # Get the current in-game time
|
||||
return (now.hour * 60) + now.min
|
||||
end
|
||||
|
||||
private
|
||||
@@ -98,34 +102,38 @@ module PBDayNight
|
||||
def self.getToneInternal
|
||||
# Calculates the tone for the current frame, used for day/night effects
|
||||
realMinutes = pbGetDayNightMinutes
|
||||
hour = realMinutes/60
|
||||
minute = realMinutes%60
|
||||
tone = PBDayNight::HourlyTones[hour]
|
||||
nexthourtone = PBDayNight::HourlyTones[(hour+1)%24]
|
||||
hour = realMinutes / 60
|
||||
minute = realMinutes % 60
|
||||
tone = PBDayNight::HourlyTones[hour]
|
||||
|
||||
nexthourtone = PBDayNight::HourlyTones[(hour + 1) % 24]
|
||||
|
||||
darkness_tone = Tone.new(-80, -100, 05, 55)
|
||||
if $game_switches[SWITCH_KANTO_DARKNESS] || darknessEffectOnCurrentMap()
|
||||
tone = darkness_tone
|
||||
nexthourtone = darkness_tone
|
||||
end
|
||||
|
||||
# Calculate current tint according to current and next hour's tint and
|
||||
# depending on current minute
|
||||
@cachedTone.red = ((nexthourtone.red-tone.red)*minute*@oneOverSixty)+tone.red
|
||||
@cachedTone.green = ((nexthourtone.green-tone.green)*minute*@oneOverSixty)+tone.green
|
||||
@cachedTone.blue = ((nexthourtone.blue-tone.blue)*minute*@oneOverSixty)+tone.blue
|
||||
@cachedTone.gray = ((nexthourtone.gray-tone.gray)*minute*@oneOverSixty)+tone.gray
|
||||
@cachedTone.red = ((nexthourtone.red - tone.red) * minute * @oneOverSixty) + tone.red
|
||||
@cachedTone.green = ((nexthourtone.green - tone.green) * minute * @oneOverSixty) + tone.green
|
||||
@cachedTone.blue = ((nexthourtone.blue - tone.blue) * minute * @oneOverSixty) + tone.blue
|
||||
@cachedTone.gray = ((nexthourtone.gray - tone.gray) * minute * @oneOverSixty) + tone.gray
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
def pbDayNightTint(object)
|
||||
return if !$scene.is_a?(Scene_Map)
|
||||
if Settings::TIME_SHADING && GameData::MapMetadata.exists?($game_map.map_id) &&
|
||||
GameData::MapMetadata.get($game_map.map_id).outdoor_map
|
||||
GameData::MapMetadata.get($game_map.map_id).outdoor_map
|
||||
tone = PBDayNight.getTone
|
||||
object.tone.set(tone.red,tone.green,tone.blue,tone.gray)
|
||||
object.tone.set(tone.red, tone.green, tone.blue, tone.gray)
|
||||
else
|
||||
object.tone.set(0,0,0,0)
|
||||
object.tone.set(0, 0, 0, 0)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Moon phases and Zodiac
|
||||
#===============================================================================
|
||||
@@ -138,50 +146,51 @@ end
|
||||
# 5 - Waning Gibbous
|
||||
# 6 - Last Quarter
|
||||
# 7 - Waning Crescent
|
||||
def moonphase(time=nil) # in UTC
|
||||
def moonphase(time = nil)
|
||||
# in UTC
|
||||
time = pbGetTimeNow if !time
|
||||
transitions = [
|
||||
1.8456618033125,
|
||||
5.5369854099375,
|
||||
9.2283090165625,
|
||||
12.9196326231875,
|
||||
16.6109562298125,
|
||||
20.3022798364375,
|
||||
23.9936034430625,
|
||||
27.6849270496875]
|
||||
yy = time.year-((12-time.mon)/10.0).floor
|
||||
j = (365.25*(4712+yy)).floor + (((time.mon+9)%12)*30.6+0.5).floor + time.day+59
|
||||
j -= (((yy/100.0)+49).floor*0.75).floor-38 if j>2299160
|
||||
j += (((time.hour*60)+time.min*60)+time.sec)/86400.0
|
||||
v = (j-2451550.1)/29.530588853
|
||||
v = ((v-v.floor)+(v<0 ? 1 : 0))
|
||||
ag = v*29.53
|
||||
1.8456618033125,
|
||||
5.5369854099375,
|
||||
9.2283090165625,
|
||||
12.9196326231875,
|
||||
16.6109562298125,
|
||||
20.3022798364375,
|
||||
23.9936034430625,
|
||||
27.6849270496875]
|
||||
yy = time.year - ((12 - time.mon) / 10.0).floor
|
||||
j = (365.25 * (4712 + yy)).floor + (((time.mon + 9) % 12) * 30.6 + 0.5).floor + time.day + 59
|
||||
j -= (((yy / 100.0) + 49).floor * 0.75).floor - 38 if j > 2299160
|
||||
j += (((time.hour * 60) + time.min * 60) + time.sec) / 86400.0
|
||||
v = (j - 2451550.1) / 29.530588853
|
||||
v = ((v - v.floor) + (v < 0 ? 1 : 0))
|
||||
ag = v * 29.53
|
||||
for i in 0...transitions.length
|
||||
return i if ag<=transitions[i]
|
||||
return i if ag <= transitions[i]
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
# Calculates the zodiac sign based on the given month and day:
|
||||
# 0 is Aries, 11 is Pisces. Month is 1 if January, and so on.
|
||||
def zodiac(month,day)
|
||||
def zodiac(month, day)
|
||||
time = [
|
||||
3,21,4,19, # Aries
|
||||
4,20,5,20, # Taurus
|
||||
5,21,6,20, # Gemini
|
||||
6,21,7,20, # Cancer
|
||||
7,23,8,22, # Leo
|
||||
8,23,9,22, # Virgo
|
||||
9,23,10,22, # Libra
|
||||
10,23,11,21, # Scorpio
|
||||
11,22,12,21, # Sagittarius
|
||||
12,22,1,19, # Capricorn
|
||||
1,20,2,18, # Aquarius
|
||||
2,19,3,20 # Pisces
|
||||
3, 21, 4, 19, # Aries
|
||||
4, 20, 5, 20, # Taurus
|
||||
5, 21, 6, 20, # Gemini
|
||||
6, 21, 7, 20, # Cancer
|
||||
7, 23, 8, 22, # Leo
|
||||
8, 23, 9, 22, # Virgo
|
||||
9, 23, 10, 22, # Libra
|
||||
10, 23, 11, 21, # Scorpio
|
||||
11, 22, 12, 21, # Sagittarius
|
||||
12, 22, 1, 19, # Capricorn
|
||||
1, 20, 2, 18, # Aquarius
|
||||
2, 19, 3, 20 # Pisces
|
||||
]
|
||||
for i in 0...12
|
||||
return i if month==time[i*4] && day>=time[i*4+1]
|
||||
return i if month==time[i*4+2] && day<=time[i*4+3]
|
||||
return i if month == time[i * 4] && day >= time[i * 4 + 1]
|
||||
return i if month == time[i * 4 + 2] && day <= time[i * 4 + 3]
|
||||
end
|
||||
return 0
|
||||
end
|
||||
@@ -189,38 +198,38 @@ end
|
||||
# Returns the opposite of the given zodiac sign.
|
||||
# 0 is Aries, 11 is Pisces.
|
||||
def zodiacOpposite(sign)
|
||||
return (sign+6)%12
|
||||
return (sign + 6) % 12
|
||||
end
|
||||
|
||||
# 0 is Aries, 11 is Pisces.
|
||||
def zodiacPartners(sign)
|
||||
return [(sign+4)%12,(sign+8)%12]
|
||||
return [(sign + 4) % 12, (sign + 8) % 12]
|
||||
end
|
||||
|
||||
# 0 is Aries, 11 is Pisces.
|
||||
def zodiacComplements(sign)
|
||||
return [(sign+1)%12,(sign+11)%12]
|
||||
return [(sign + 1) % 12, (sign + 11) % 12]
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Days of the week
|
||||
#===============================================================================
|
||||
def pbIsWeekday(wdayVariable,*arg)
|
||||
def pbIsWeekday(wdayVariable, *arg)
|
||||
timenow = pbGetTimeNow
|
||||
wday = timenow.wday
|
||||
ret = false
|
||||
for wd in arg
|
||||
ret = true if wd==wday
|
||||
ret = true if wd == wday
|
||||
end
|
||||
if wdayVariable>0
|
||||
if wdayVariable > 0
|
||||
$game_variables[wdayVariable] = [
|
||||
_INTL("Sunday"),
|
||||
_INTL("Monday"),
|
||||
_INTL("Tuesday"),
|
||||
_INTL("Wednesday"),
|
||||
_INTL("Thursday"),
|
||||
_INTL("Friday"),
|
||||
_INTL("Saturday")][wday]
|
||||
_INTL("Sunday"),
|
||||
_INTL("Monday"),
|
||||
_INTL("Tuesday"),
|
||||
_INTL("Wednesday"),
|
||||
_INTL("Thursday"),
|
||||
_INTL("Friday"),
|
||||
_INTL("Saturday")][wday]
|
||||
$game_map.need_refresh = true if $game_map
|
||||
end
|
||||
return ret
|
||||
@@ -229,14 +238,14 @@ end
|
||||
#===============================================================================
|
||||
# Months
|
||||
#===============================================================================
|
||||
def pbIsMonth(monVariable,*arg)
|
||||
def pbIsMonth(monVariable, *arg)
|
||||
timenow = pbGetTimeNow
|
||||
thismon = timenow.mon
|
||||
ret = false
|
||||
for wd in arg
|
||||
ret = true if wd==thismon
|
||||
ret = true if wd == thismon
|
||||
end
|
||||
if monVariable>0
|
||||
if monVariable > 0
|
||||
$game_variables[monVariable] = pbGetMonthName(thismon)
|
||||
$game_map.need_refresh = true if $game_map
|
||||
end
|
||||
@@ -255,7 +264,7 @@ def pbGetMonthName(month)
|
||||
_INTL("September"),
|
||||
_INTL("October"),
|
||||
_INTL("November"),
|
||||
_INTL("December")][month-1]
|
||||
_INTL("December")][month - 1]
|
||||
end
|
||||
|
||||
def pbGetAbbrevMonthName(month)
|
||||
@@ -278,31 +287,50 @@ end
|
||||
# Seasons
|
||||
#===============================================================================
|
||||
def pbGetSeason
|
||||
return (pbGetTimeNow.mon-1)%4
|
||||
return (pbGetTimeNow.mon - 1) % 4
|
||||
end
|
||||
|
||||
def pbIsSeason(seasonVariable,*arg)
|
||||
def pbIsSeason(seasonVariable, *arg)
|
||||
thisseason = pbGetSeason
|
||||
ret = false
|
||||
for wd in arg
|
||||
ret = true if wd==thisseason
|
||||
ret = true if wd == thisseason
|
||||
end
|
||||
if seasonVariable>0
|
||||
if seasonVariable > 0
|
||||
$game_variables[seasonVariable] = [
|
||||
_INTL("Spring"),
|
||||
_INTL("Summer"),
|
||||
_INTL("Autumn"),
|
||||
_INTL("Winter")][thisseason]
|
||||
_INTL("Spring"),
|
||||
_INTL("Summer"),
|
||||
_INTL("Autumn"),
|
||||
_INTL("Winter")][thisseason]
|
||||
$game_map.need_refresh = true if $game_map
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
def pbIsSpring; return pbIsSeason(0,0); end # Jan, May, Sep
|
||||
def pbIsSummer; return pbIsSeason(0,1); end # Feb, Jun, Oct
|
||||
def pbIsAutumn; return pbIsSeason(0,2); end # Mar, Jul, Nov
|
||||
def pbIsFall; return pbIsAutumn; end
|
||||
def pbIsWinter; return pbIsSeason(0,3); end # Apr, Aug, Dec
|
||||
def pbIsSpring
|
||||
return pbIsSeason(0, 0);
|
||||
end
|
||||
|
||||
# Jan, May, Sep
|
||||
def pbIsSummer
|
||||
return pbIsSeason(0, 1);
|
||||
end
|
||||
|
||||
# Feb, Jun, Oct
|
||||
def pbIsAutumn
|
||||
return pbIsSeason(0, 2);
|
||||
end
|
||||
|
||||
# Mar, Jul, Nov
|
||||
def pbIsFall
|
||||
return pbIsAutumn;
|
||||
end
|
||||
|
||||
def pbIsWinter
|
||||
return pbIsSeason(0, 3);
|
||||
end
|
||||
|
||||
# Apr, Aug, Dec
|
||||
|
||||
def pbGetSeasonName(season)
|
||||
return [_INTL("Spring"),
|
||||
|
||||
@@ -401,6 +401,9 @@ def pbTransferUnderwater(mapid, x, y, direction = $game_player.direction)
|
||||
$game_temp.player_new_x = x
|
||||
$game_temp.player_new_y = y
|
||||
$game_temp.player_new_direction = direction
|
||||
$PokemonGlobal.diving = true
|
||||
$PokemonGlobal.surfing = false
|
||||
|
||||
$scene.transfer_player(false)
|
||||
$game_map.autoplay
|
||||
$game_map.refresh
|
||||
@@ -425,7 +428,6 @@ Events.onAction += proc { |_sender, _e|
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
HiddenMoveHandlers::CanUseMove.add(:DIVE, proc { |move, pkmn, showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE, showmsg)
|
||||
if $PokemonGlobal.diving
|
||||
@@ -492,7 +494,7 @@ HiddenMoveHandlers::UseMove.add(:DIVE, proc { |move, pokemon|
|
||||
HiddenMoveHandlers::CanUseMove.add(:FLASH, proc { |move, pkmn, showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_FLASH, showmsg)
|
||||
if !GameData::MapMetadata.exists?($game_map.map_id) ||
|
||||
!GameData::MapMetadata.get($game_map.map_id).dark_map
|
||||
!(GameData::MapMetadata.get($game_map.map_id).dark_map || darknessEffectOnCurrentMap())
|
||||
pbMessage(_INTL("Can't use that here.")) if showmsg
|
||||
next false
|
||||
end
|
||||
@@ -825,6 +827,49 @@ Events.onAction += proc { |_sender, _e|
|
||||
pbSurf
|
||||
}
|
||||
|
||||
#Flowers
|
||||
Events.onAction += proc { |_sender, _e|
|
||||
next if !$game_player.pbFacingTerrainTag.flower
|
||||
if $game_player.pbFacingTerrainTag.flowerRed
|
||||
if $game_switches[SWITCH_ORICORIO_QUEST_IN_PROGRESS]
|
||||
oricorioEventPickFlower(:RED)
|
||||
else
|
||||
changeOricorioFlower(1)
|
||||
end
|
||||
end
|
||||
if $game_player.pbFacingTerrainTag.flowerYellow
|
||||
if $game_switches[SWITCH_ORICORIO_QUEST_IN_PROGRESS]
|
||||
|
||||
else
|
||||
changeOricorioFlower(2)
|
||||
end
|
||||
end
|
||||
if $game_player.pbFacingTerrainTag.flowerPink
|
||||
if $game_switches[SWITCH_ORICORIO_QUEST_IN_PROGRESS]
|
||||
oricorioEventPickFlower(:PINK)
|
||||
else
|
||||
changeOricorioFlower(3)
|
||||
end
|
||||
end
|
||||
if $game_player.pbFacingTerrainTag.flowerBlue
|
||||
if $game_switches[SWITCH_ORICORIO_QUEST_IN_PROGRESS]
|
||||
oricorioEventPickFlower(:BLUE)
|
||||
else
|
||||
changeOricorioFlower(4)
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
#Trashcan
|
||||
Events.onAction += proc { |_sender, _e|
|
||||
next if !$game_player.pbFacingTerrainTag.trashcan
|
||||
if $PokemonGlobal.stepcount % 25 == 0
|
||||
pbMessage(_INTL("Woah! A Pokémon jumped out of the trashcan!"))
|
||||
pbWildBattle(:TRUBBISH, 10)
|
||||
$PokemonGlobal.stepcount += 1
|
||||
end
|
||||
}
|
||||
|
||||
HiddenMoveHandlers::CanUseMove.add(:SURF, proc { |move, pkmn, showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF, showmsg)
|
||||
if $PokemonGlobal.surfing
|
||||
@@ -1041,8 +1086,6 @@ HiddenMoveHandlers::UseMove.add(:WATERFALL, proc { |move, pokemon|
|
||||
next true
|
||||
})
|
||||
|
||||
|
||||
|
||||
HiddenMoveHandlers::CanUseMove.add(:ROCKCLIMB, proc { |move, pkmn, showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_ROCKCLIMB, showmsg)
|
||||
if !$game_player.pbFacingTerrainTag.ledge
|
||||
|
||||
Reference in New Issue
Block a user