- 658
- Posts
- 8
- Years
- he/him
- Alola Reigon
- Seen Nov 24, 2023
Hey Kyure. I've made the code for Aura Wheel and sent a pull request but you didn't update the scripts. Should I send the script here?
#===============================================================================
# Ignores move redirection from abilities and moves. (Snipe Shot)
# By Aioros
#===============================================================================
class PokeBattle_Move_186 < PokeBattle_Move
end
##
#After return targets if user.hasActiveAbility?(:STALWART) || user.hasActiveAbility?(:PROPELLERTAIL)
#In def pbChangeTargets(move,user,targets), add:
return targets if isConst?(move.id,PBMoves,:SNIPESHOT)
##
#===============================================================================
# Target becomes Psychic type. (Magic Powder)
# By Aioros
#===============================================================================
class PokeBattle_Move_200 < PokeBattle_Move
def pbFailsAgainstTarget?(user,target)
if !target.canChangeType? ||
!target.pbHasOtherType?(getConst(PBTypes,:PSYCHIC))
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
return false
end
def pbEffectAgainstTarget(user,target)
newType = getConst(PBTypes,:PSYCHIC)
target.pbChangeTypes(newType)
typeName = PBTypes.getName(newType)
@battle.pbDisplay(_INTL("{1} transformed into the {2} type!",target.pbThis,typeName))
end
end
################################################################################
# Swaps barriers, veils and other effects between each side of the battlefield.
# (Court Change)
# By Aioros based on WolfPP
################################################################################
class PokeBattle_Move_201 < PokeBattle_Move
def pbEffectAgainstTarget(user,target)
fail=false
neffectsuser=[]
beffectsuser=[]
neffectsopp=[]
beffectsopp=[]
for i in 0...2
i==0 ? a=user : a=target
i==0 ? b=neffectsuser : b=neffectsopp
i==0 ? c=beffectsuser : c=beffectsopp
fail=true if a.pbOwnSide.effects[PBEffects::Reflect] > 0
b.push(a.pbOwnSide.effects[PBEffects::Reflect])
fail=true if a.pbOwnSide.effects[PBEffects::LightScreen] > 0
b.push(a.pbOwnSide.effects[PBEffects::LightScreen])
fail=true if a.pbOwnSide.effects[PBEffects::AuroraVeil] > 0
b.push(a.pbOwnSide.effects[PBEffects::AuroraVeil])
fail=true if a.pbOwnSide.effects[PBEffects::SeaOfFire] > 0
b.push(a.pbOwnSide.effects[PBEffects::SeaOfFire])
fail=true if a.pbOwnSide.effects[PBEffects::Swamp] > 0
b.push(a.pbOwnSide.effects[PBEffects::Swamp])
fail=true if a.pbOwnSide.effects[PBEffects::Rainbow] > 0
b.push(a.pbOwnSide.effects[PBEffects::Rainbow])
fail=true if a.pbOwnSide.effects[PBEffects::Mist] > 0
b.push(a.pbOwnSide.effects[PBEffects::Mist])
fail=true if a.pbOwnSide.effects[PBEffects::Safeguard] > 0
b.push(a.pbOwnSide.effects[PBEffects::Safeguard])
fail=true if a.pbOwnSide.effects[PBEffects::Spikes] > 0
b.push(a.pbOwnSide.effects[PBEffects::Spikes])
fail=true if a.pbOwnSide.effects[PBEffects::ToxicSpikes] > 0
b.push(a.pbOwnSide.effects[PBEffects::ToxicSpikes])
fail=true if a.pbOwnSide.effects[PBEffects::Tailwind] > 0
b.push(a.pbOwnSide.effects[PBEffects::Tailwind])
fail=true if a.pbOwnSide.effects[PBEffects::StealthRock]
c.push(a.pbOwnSide.effects[PBEffects::StealthRock])
fail=true if a.pbOwnSide.effects[PBEffects::StickyWeb]
c.push(a.pbOwnSide.effects[PBEffects::StickyWeb])
end
if !fail
@battle.pbDisplay(_INTL("But it failed!"))
return -1
else
user.pbOwnSide.effects[PBEffects::Reflect] = neffectsopp[0]
target.pbOwnSide.effects[PBEffects::Reflect] = neffectsuser[0]
user.pbOwnSide.effects[PBEffects::LightScreen] = neffectsopp[1]
target.pbOwnSide.effects[PBEffects::LightScreen] = neffectsuser[1]
user.pbOwnSide.effects[PBEffects::AuroraVeil] = neffectsopp[2]
target.pbOwnSide.effects[PBEffects::AuroraVeil] = neffectsuser[2]
user.pbOwnSide.effects[PBEffects::SeaOfFire] = neffectsopp[3]
target.pbOwnSide.effects[PBEffects::SeaOfFire] = neffectsuser[3]
user.pbOwnSide.effects[PBEffects::Swamp] = neffectsopp[4]
target.pbOwnSide.effects[PBEffects::Swamp] = neffectsuser[4]
user.pbOwnSide.effects[PBEffects::Rainbow] = neffectsopp[5]
target.pbOwnSide.effects[PBEffects::Rainbow] = neffectsuser[5]
user.pbOwnSide.effects[PBEffects::Mist] = neffectsopp[6]
target.pbOwnSide.effects[PBEffects::Mist] = neffectsuser[6]
user.pbOwnSide.effects[PBEffects::Safeguard] = neffectsopp[7]
target.pbOwnSide.effects[PBEffects::Safeguard] = neffectsuser[7]
user.pbOwnSide.effects[PBEffects::Spikes] = neffectsopp[8]
target.pbOwnSide.effects[PBEffects::Spikes] = neffectsuser[8]
user.pbOwnSide.effects[PBEffects::ToxicSpikes] = neffectsopp[9]
target.pbOwnSide.effects[PBEffects::ToxicSpikes] = neffectsuser[9]
user.pbOwnSide.effects[PBEffects::Tailwind] = neffectsopp[10]
target.pbOwnSide.effects[PBEffects::Tailwind] = neffectsuser[10]
user.pbOwnSide.effects[PBEffects::StealthRock] = beffectsopp[0]
target.pbOwnSide.effects[PBEffects::StealthRock] = beffectsuser[0]
user.pbOwnSide.effects[PBEffects::StickyWeb] = beffectsopp[1]
target.pbOwnSide.effects[PBEffects::StickyWeb] = beffectsuser[1]
@battle.pbDisplay(_INTL("{1} swapped the battle effects affecting each side of the field!",user.pbThis))
return 0
end
end
end
################################################################################
# Raises all user's stats by 1 stage in exchange for the user losing 1/3 of its
# maximum HP, rounded down. Fails if the user would faint. (Clangorous Soul)
# By Aioros based on WolfPP
################################################################################
class PokeBattle_Move_202 < PokeBattle_Move
def pbMoveFailed?(user,targets)
if user.hp<=(user.totalhp/3) ||
!user.pbCanRaiseStatStage?(PBStats::ATTACK,user,self) ||
!user.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self) ||
!user.pbCanRaiseStatStage?(PBStats::SPEED,user,self) ||
!user.pbCanRaiseStatStage?(PBStats::SPATK,user,self) ||
!user.pbCanRaiseStatStage?(PBStats::SPDEF,user,self)
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
return false
end
def pbEffectGeneral(user)
if user.pbCanRaiseStatStage?(PBStats::ATTACK,user,self)
user.pbRaiseStatStage(PBStats::ATTACK,1,user)
end
if user.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self)
user.pbRaiseStatStage(PBStats::DEFENSE,1,user)
end
if user.pbCanRaiseStatStage?(PBStats::SPEED,user,self)
user.pbRaiseStatStage(PBStats::SPEED,1,user)
end
if user.pbCanRaiseStatStage?(PBStats::SPATK,user,self)
user.pbRaiseStatStage(PBStats::SPATK,1,user)
end
if user.pbCanRaiseStatStage?(PBStats::SPDEF,user,self)
user.pbRaiseStatStage(PBStats::SPDEF,1,user)
end
user.pbReduceHP(user.totalhp/3,false)
end
end
#===============================================================================
# User is protected against damaging moves this round. Decreases the Defense of
# the user of a stopped contact move by 2 stages. (Obstruct)
# Obstruct by Aioros based on WolfPP
#===============================================================================
class PokeBattle_Move_184 < PokeBattle_ProtectMove
def initialize(battle,move)
super
@effect = PBEffects::Obstruct
end
end
#In PBEffects after perishbody add:
Obstruct = 117
#In Battler_Initialize after perishbody, add:
@effects[PBEffects::Obstruct] = false
#In Battle_Phase_EndOfRound add after:
# b.effects[PBEffects::ThroatChop] -= 1 if b.effects[PBEffects::ThroatChop]>0
b.effects[PBEffects::Obstruct] = false
#In Battler_UseMove_SuccessChecks add after protect and before king's shield (for example):
if target.effects[PBEffects::Obstruct]
@battle.pbCommonAnimation("Obstruct",target)
@battle.pbDisplay(_INTL("{1} protected itself!",target.pbThis))
target.damageState.protected = true
@battle.successStates[user.index].protected = true
if move.pbContactMove?(user) && user.affectedByContactEffect?
if user.pbCanLowerStatStage?(PBStats::DEFENSE)
user.pbLowerStatStage(PBStats::DEFENSE,2,nil)
end
end
return false
end
#Change pbs to
700,OBSTRUCT,Obstruct,184,0,DARK,Status,0,10,0,User,4,,"This move enables the user to protect itself from all attacks. Its chance of failing rises if it is used in succession. Direct contact harshly lowers the attacker's Defense stat."
#Look for 0AA move code in move functions and in blacklists of Copycat, Assist and Metronome add to their blacklist "184," like this:
# Protection moves
"0AA", # Detect, Protect
"184", # Obstruct
"0AB", # Quick Guard # Not listed on Bulbapedia
#===============================================================================
# Consumes berry and raises the user's Defense by 2 stages. (Stuff Cheeks)
# By Aioros based on WolfPP
#===============================================================================
class PokeBattle_Move_187 < PokeBattle_Move
def pbEffectGeneral(user)
if user.item==0 || !pbIsBerry?(user.item)
@battle.pbDisplay("But it failed!")
return -1
end
if user.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self)
user.pbRaiseStatStage(PBStats::DEFENSE,2,user)
end
user.pbHeldItemTriggerCheck(user.item,false)
user.pbConsumeItem(true,true,false) if user.item>0
user.pbRemoveItem if pbIsBerry?(target.item) ##added this line to fix a bug
end
end
#In Battler_UseMove_SuccessChecks
#In def pbCanChooseMove?(move,commandPhase,showMessages=true,specialUsage=false) before Disable add:
# Stuff Cheeks
if move.function=="187" && (self.item==0 || !pbIsBerry?(self.item))
if showMessages
msg = _INTL("{1} can't use that move because it doesn't have any berry!",pbThis,move.name)
(commandPhase) ? @battle.pbDisplayPaused(msg) : @battle.pbDisplay(msg)
end
return false
end
#===============================================================================
# Prevents both the user and the target from escaping. (Jaw Lock)
#===============================================================================
class PokeBattle_Move_181 < PokeBattle_Move
def pbEffectAgainstTarget(user,target)
if target.effects[PBEffects::JawLockUser]<0 && !target.effects[PBEffects::JawLock] &&
user.effects[PBEffects::JawLockUser]<0 && !user.effects[PBEffects::JawLock]
user.effects[PBEffects::JawLock] = true
target.effects[PBEffects::JawLock] = true
user.effects[PBEffects::JawLockUser] = user.index
target.effects[PBEffects::JawLockUser] = user.index
@battle.pbDisplay(_INTL("Neither Pokémon can run away!"))
end
end
end
#In PBEffects add below obstruct (or yawn.. ur last effect):
JawLock = 118
JawLockUser = 119
#In Battler_Initialize add:
@battle.eachBattler do |b| # Other battlers lose their lock-on against self - Jawlock
next if !b.effects[PBEffects::JawLock]
next if b.effects[PBEffects::JawLockUser]!=@index
b.effects[PBEffects::Jawlock] = false
b.effects[PBEffects::JawLockUser] = -1
end
#above
# @battle.eachBattler do |b| # Other battlers lose their lock-on against self
# next if b.effects[PBEffects::LockOn]==0
# next if b.effects[PBEffects::LockOnPos]!=@index
# b.effects[PBEffects::LockOn] = 0
# b.effects[PBEffects::LockOnPos] = -1
# end
#and add:
@effects[PBEffects::JawLock] = false
@effects[PBEffects::JawLockUser] = -1
#below @effects[PBEffects::Telekinesis] = 0 (still in battler_initialize
#In Battle_Action_Switching
#In def pbCanSwitch?(idxBattler,idxParty=-1,partyScene=nil)
#below # Other certain trapping effects
if battler.effects[PBEffects::JawLock]
@battlers.each do |b|
if (battler.effects[PBEffects::JawLockUser] == b.index) && !b.fainted?
partyScene.pbDisplay(_INTL("{1} can't be switched out!",battler.pbThis)) if partyScene
return false
end
end
end
#In Battle_Action_Running
#In def pbCanRun?(idxBattler), add:
#battler.effects[PBEffects::Ingrain] ||
battler.effects[PBEffects::JawLock] ||
#@field.effects[PBEffects::FairyLock]>0
#In def pbRun(idxBattler,duringBattle=false), add:
#battler.effects[PBEffects::Ingrain] ||
battler.effects[PBEffects::JawLock] ||
#@field.effects[PBEffects::FairyLock]>0
#Change in pbs:
695,JAWLOCK,Jaw Lock,181,80,DARK,Physical,100,10,100,00,0,bef,"This move prevents the user and the target from switching out until either of them faints. The effect goes away if either of the Pokémon leaves the field."
#===============================================================================
# Decrease 1 stage of speed and weakens target to fire moves
# By Aioros
#===============================================================================
class PokeBattle_Move_203 < PokeBattle_Move
def pbEffectAgainstTarget(user,target)
if !target.pbCanLowerStatStage?(PBStats::SPEED,target,self) && !target.effects[PBEffects::TarShot]
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
if target.pbCanLowerStatStage?(PBStats::SPEED,target,self)
target.pbLowerStatStage(PBStats::SPEED,1,target)
end
if target.effects[PBEffects::TarShot]==false
target.effects[PBEffects::TarShot]=true
@battle.pbDisplay(_INTL("{1} became weaker to fire!",target.pbThis))
end
end
end
#In PBEffects add after yawn / jawlock
TarShot = 120
#In Battler_Initialize add after yawn / obstruct
@effects[PBEffects::TarShot] = false
#In Move_Usage_Calculations, above Mud Sport, add:
# Tar Shot
if target.effects[PBEffects::TarShot] && isConst?(type,PBTypes,:FIRE)
multipliers[BASE_DMG_MULT] *= 2
end
#PBS
710,TARSHOT,Tar Shot,203,0,ROCK,Status,100,15,0,00,0,bce,"The user pours sticky tar over the target, lowering the target's Speed stat. The target becomes weaker to Fire-type moves."
#===============================================================================
# Forces all active Pokémon to consume their held berries. This move bypasses
# Substitutes. (Tea Time)
# By Aioros
#===============================================================================
class PokeBattle_Move_188 < PokeBattle_Move
def pbMoveFailed?(user,targets)
@validTargets = []
@battle.eachBattler do |b|
next if !b.item == 0 || !pbIsBerry?(b.item)
@validTargets.push(b.index)
end
if @validTargets.length==0
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
@battle.pbDisplay(_INTL("It's tea time! Everyone dug in to their Berries!"))
return false
end
def pbFailsAgainstTarget?(user,target)
return false if @validTargets.include?(target.index)
return true if target.semiInvulnerable?
end
def pbEffectAgainstTarget(user,target)
target.pbHeldItemTriggerCheck(user.item,false)
target.pbConsumeItem(true,true,false) if user.item>0
target.pbRemoveItem if pbIsBerry?(target.item)
end
end
#pbs
711,TEATIME,Teatime,188,0,NORMAL,Status,0,10,0,7,0,,"The user has teatime with all the Pokémon in the battle. Each Pokémon eats its held Berry "
Very easySo how easy is it to implement scripts to the game?
Hey implemented the scripts and wanted to take a look at them but it looks like this.
How do i decrypt the game so i can view the scripts?
Hey implemented the scripts and wanted to take a look at them but it looks like this.
How do i decrypt the game so i can view the scripts?
Ok i read the message in the scripts wrong. so how it works now is that each folder in scripts has ruby files in them that you can just edit to make adjustments? So basically it runs differently to base v18 now?Look at the Scripts folder in Data. Its all decryped. Read the Readme file to learn how to encrypt.
Ok i read the message in the scripts wrong. so how it works now is that each folder in scripts has ruby files in them that you can just edit to make adjustments? So basically it runs differently to base v18 now?
if @pokemon.species == isConst?(@pokemon.species,PBSpecies,:MORPEKO) || @pokemon.form!=0
if @pokemon.species == isConst?(@pokemon.species,PBSpecies,:MORPEKO) && @pokemon.form!=0
So how exactly do i implement the gen 8 scripts i have the graphics for the pokemon?