- 2
- Posts
- 1
- Years
- Seen Jun 25, 2024
I was curious, if I wanted to add just Sharpness ability into my game without the rest of the pack, how would I go about telling the game what slicing moves are? I have copied the script from the pack into the base Abilities script but how do I define what a slicingMove is?
Battle::AbilityEffects::DamageCalcFromUser.add(:SHARPNESS,
proc { |ability, user, target, move, mults, baseDmg, type|
mults[:power_multiplier] *= 1.5 if move.slicingMove?
}
)
*edit*
Found a solution in case anyone else wants to do the same. I am working on v20 btw
Battle::AbilityEffects::DamageCalcFromUser.add(:SHARPNESS,
proc { |ability, user, target, move, mults, baseDmg, type|
mults[:base_damage_multiplier] *= 1.5 if move.slicingMove?
}
)
v20 uses base_damage_multiplier instead of power_multiplier so I just changed that. Also, in the Battle_Move script, I added the following line from the Battle.rb in the download pack,
def slicingMove?; return @flags.any? { |f| f[/^Slicing$/i] }; end
Then just made sure that all slicing moves have the flag which I added manually.
I am sure that it would have been easier if I have just added the whole pack as instructed but as I am very new to programming language and don't really know what I am doing, I am proud that I figured this out.
I will still be crediting appropriately, thank you Caruban for doing the hard work
Battle::AbilityEffects::DamageCalcFromUser.add(:SHARPNESS,
proc { |ability, user, target, move, mults, baseDmg, type|
mults[:power_multiplier] *= 1.5 if move.slicingMove?
}
)
*edit*
Found a solution in case anyone else wants to do the same. I am working on v20 btw
Battle::AbilityEffects::DamageCalcFromUser.add(:SHARPNESS,
proc { |ability, user, target, move, mults, baseDmg, type|
mults[:base_damage_multiplier] *= 1.5 if move.slicingMove?
}
)
v20 uses base_damage_multiplier instead of power_multiplier so I just changed that. Also, in the Battle_Move script, I added the following line from the Battle.rb in the download pack,
def slicingMove?; return @flags.any? { |f| f[/^Slicing$/i] }; end
Then just made sure that all slicing moves have the flag which I added manually.
I am sure that it would have been easier if I have just added the whole pack as instructed but as I am very new to programming language and don't really know what I am doing, I am proud that I figured this out.
I will still be crediting appropriately, thank you Caruban for doing the hard work
Last edited: