- 1,766
- Posts
- 9
- Years
- Seen today
So, def moonphase is one of those methods that's in the scripts but doesn't actually get used. It returns the phase of the moon as an integer.
Unused methods make me sad, so here's some love for it!
You may want to speed the passage of time, as each phase of the moon takes a few days. An indicator to the player would also be nice, but outside of the scope of this tutorial.
Evolution Method: Evolve if the moon phase is a particular one.
Moves: Base power changes based on the moon phase
Code:
0 - New Moon
1 - Waxing Crescent
2 - First Quarter
3 - Waxing Gibbous
4 - Full Moon
5 - Waning Gibbous
6 - Last Quarter
7 - Waning Crescent
Unused methods make me sad, so here's some love for it!
You may want to speed the passage of time, as each phase of the moon takes a few days. An indicator to the player would also be nice, but outside of the scope of this tutorial.
Evolution Method: Evolve if the moon phase is a particular one.
Spoiler:
First things first, we have to define the constant for it in module PBEvolution. I renamed Custom1 to MoonPhase, which is the name I will use for the remainder of the tutorial.
We also need to edit EVONAMES to have our new name. Once again, I renamed "Custom1" to "MoonPhase".
By default, Custom1 through 5 take a positive integer as parameter, so if you renamed the constant, you won't have to edit EVOPARAM. If you extended the amount of constants, we need to set the parameter to 1
Now that the constant is all set up, we can edit def pbMiniCheckEvolution. As I renamed Custom1, I had to replace it with the new code, but if you're extending, you can add it above the end before the return -1
With the code set up now, we can edit the PBS files to add this moon phase evo method. As seen at the top of the page, a new moon is 0, and a full moon is 4, with the other phases from 1 through 7. My example will be adding a full moon phase as an alternative method to evolve Clefairy to Clefable.
You can add the evolution method multiple times, each with a different phase if you wanted a larger range, like how Magneton has three maps it can evolve on by default.
Code:
MoonPhase = 31
Code:
EVONAMES=["Unknown",
"Happiness","HappinessDay","HappinessNight","Level","Trade",
"TradeItem","Item","AttackGreater","AtkDefEqual","DefenseGreater",
"Silcoon","Cascoon","Ninjask","Shedinja","Beauty",
"ItemMale","ItemFemale","DayHoldItem","NightHoldItem","HasMove",
"HasInParty","LevelMale","LevelFemale","Location","TradeSpecies",
"LevelDay","LevelNight","LevelDarkInParty","LevelRain","HappinessMoveType",
"MoonPhase","Custom2","Custom3","Custom4","Custom5"
]
Code:
EVOPARAM=[0, # Unknown (do not use)
0,0,0,1,0, # Happiness, HappinessDay, HappinessNight, Level, Trade
2,2,1,1,1, # TradeItem, Item, AttackGreater, AtkDefEqual, DefenseGreater
1,1,1,1,1, # Silcoon, Cascoon, Ninjask, Shedinja, Beauty
2,2,2,2,3, # ItemMale, ItemFemale, DayHoldItem, NightHoldItem, HasMove
4,1,1,1,4, # HasInParty, LevelMale, LevelFemale, Location, TradeSpecies
1,1,1,1,5, # LevelDay, LevelNight, LevelDarkInParty, LevelRain, HappinessMoveType
1,1,1,1,1 # MoonPhase, Custom 2-5
]
Now that the constant is all set up, we can edit def pbMiniCheckEvolution. As I renamed Custom1, I had to replace it with the new code, but if you're extending, you can add it above the end before the return -1
Code:
when PBEvolution::MoonPhase
return poke if moonphase()==level
With the code set up now, we can edit the PBS files to add this moon phase evo method. As seen at the top of the page, a new moon is 0, and a full moon is 4, with the other phases from 1 through 7. My example will be adding a full moon phase as an alternative method to evolve Clefairy to Clefable.
Code:
Evolutions=CLEFABLE,Item,MOONSTONE,CLEFABLE,MoonPhase,4
Moves: Base power changes based on the moon phase
Spoiler:
These two moves are basically Return/Frustration, but for the Full and New moon.
Remember to change the XXX and YYY to the move effect index
Here's the PBS entries I used to test them. Feel free to change the specifics of the moves, but don't change the base power though, as we need it to be set to 1 for Essentials to display it as a variable power move. Remember to change the XXX and YYY to the move effect number!
Remember to change the XXX and YYY to the move effect index
Code:
################################################################################
# Stronger on full moons, weaker on new moons
# 0 - New Moon
# 1 - Waxing Crescent
# 2 - First Quarter
# 3 - Waxing Gibbous
# 4 - Full Moon
# 5 - Waning Gibbous
# 6 - Last Quarter
# 7 - Waning Crescent
################################################################################
class PokeBattle_Move_XXX < PokeBattle_Move
def pbBaseDamage(basedmg,attacker,opponent)
return [10,20,30,40,50,40,30,20][moonphase()]
end
end
################################################################################
# Stronger on new moons, weaker on full moons
# 0 - New Moon
# 1 - Waxing Crescent
# 2 - First Quarter
# 3 - Waxing Gibbous
# 4 - Full Moon
# 5 - Waning Gibbous
# 6 - Last Quarter
# 7 - Waning Crescent
################################################################################
class PokeBattle_Move_YYY < PokeBattle_Move
def pbBaseDamage(basedmg,attacker,opponent)
return [50,40,30,20,10,20,30,40][moonphase()]
end
end
Code:
ID1,FULLMOONBLAST,Full Moon Blast,XXX,1,NORMAL,Special,100,10,0,00,0,bf,"The power of the move comes from the full moon."
ID2,NEWMOONBLOW,New Moon Blow,YYY,1,NORMAL,Special,100,10,0,00,0,bf,"The power of the move comes from the new moon."