首先感谢社区里很多大佬的协助,让我这个场地平稳落地了,在这里把这个我个人觉得挺有趣的场地分享出来
##########屎山代码警告##########
##########屎山代码警告##########
Ruby:
#定义秘蕈场地
#①:写在016_BattleTerrain
GameData::BattleTerrain.register({
:id => :Bugy,
:name => _INTL("秘蕈"),
:animation => "BugyTerrain"
})
#②:写在def pbStartBattleCore
when :Bugy
pbDisplay(_INTL("幽闭的密林气息从脚下传来!"))
#③:写在def pbStartTerrain
when :Bugy
pbDisplay(_INTL("幽闭的密林气息从脚下传来!"))
#④:写在def pbEOREndTerrain
when :Bugy
pbDisplay(_INTL("森林的气息消失了!"))
#⑤:定义域同上
when :Bugy then pbDisplay(_INTL("森林依旧繁茂!"))
#虫场效果
#①虫系1.5倍增伤
#写在Terrain moves
when :Bugy
multipliers[:power_multiplier] *= 1.5 if type == :BUG && user.affectedByTerrain?
#②虫系毒系命中率*1.1
#写在def pbCalcAccuracyModifiers
if @battle.field.terrain == :Bugy
if user.pbHasType?(:BUG) || user.pbHasType?( :POISON)
if user.affectedByTerrain?
modifiers[:accuracy_multiplier] *= 1.1
end
end
end
#③多段攻击会多打一次
#连环巴掌,连续拳,乱击等方法:HitTwoToFiveTimes(√)
#鳞射:HitTwoToFiveTimesRaiseUserSpd1LowerUserDef1(√)
class Battle::Move::HitTwoToFiveTimes < Battle::Move
def multiHitMove?; return true; end
def pbNumHits(user, targets)
hitChances = [
2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3,
4, 4, 4,
5, 5, 5
]
ret = hitChances.sample
if @battle.field.terrain == :Bugy
if user.affectedByTerrain?
@battle.pbShowAbilitySplash(user)
@battle.pbHideAbilitySplash(user)
ret += 1
end
if user.hasActiveAbility?(:SKILLLINK)
if @battle.field.terrain == :Bugy && user.affectedByTerrain?
ret = 6
else
ret = 5
end
end
return ret
end
end
#飞水手里剑:HitTwoToFiveTimesOrThreeForAshGreninja(√)
class Battle::Move::HitTwoToFiveTimesOrThreeForAshGreninja < Battle::Move::HitTwoToFiveTimes
def pbNumHits(user, targets)
if user.isSpecies?(:GRENINJA) && user.form == 2
if @battle.field.terrain == :Bugy && user.affectedByTerrain?
return 4
else
return 3
end
end
return super
end
#水流连打:HitThreeTimesAlwaysCriticalHit(√)
class Battle::Move::HitThreeTimesAlwaysCriticalHit < Battle::Move
def multiHitMove?; return true; end
def pbNumHits(user, targets)
if @battle.field.terrain == :Bugy && user.affectedByTerrain?
return 4
else
return 3
end
end
def pbOnStartUse(user, targets)
user.check_every_hit = true
end
def pbCritialOverride(user, target)
case user.current_hit
when 0 then return 1
when 1 then return 1
when 2 then return 1
when 3 then return -1
end
end
def pbEffectAfterAllHits(user, target)
user.check_every_hit = false
user.current_hit = 0
end
end
#(# Attack a single target)
user.current_hit = hitNum
#(# Things the battler has done in battle)
attr_accessor :current_hit
attr_accessor :check_every_hit
#三连钻:HitThreeTimes(√)
def multiHitMove?; return true; end
def pbNumHits(user, targets)
if @battle.field.terrain == :Bugy && user.affectedByTerrain?
return 4
else
return 3
end
end
#二连踢等:HitTwoTimes(√)
#双针:HitTwoTimesPoisonTarget(√)
#钢拳双击:HitTwoTimesFlinchTarget(√)
def pbNumHits(user, targets)
if @battle.field.terrain == :Bugy && user.affectedByTerrain?
return 3
else
return 2
end
end
#龙箭:HitTwoTimesTargetThenTargetAlly(做不到不可能)
#三连踢:HitThreeTimesPowersUpWithEachHit(√)
class Battle::Move::HitThreeTimesPowersUpWithEachHit < Battle::Move
def multiHitMove?; return true; end
def pbNumHits(user, targets)
if @battle.field.terrain == :Bugy && user.affectedByTerrain?
return 4
else
return 3
end
end
def successCheckPerHit?
return @accCheckPerHit
end
def pbOnStartUse(user, targets)
@calcBaseDmg = 0
@accCheckPerHit = !user.hasActiveAbility?(:SKILLLINK)
user.check_every_hit = true
end
def pbBaseDamage(baseDmg, user, target)
case user.current_hit
when 0 then @calcBaseDmg += baseDmg
when 1 then @calcBaseDmg += baseDmg
when 2 then @calcBaseDmg += baseDmg
when 3 then @calcBaseDmg += 0
return @calcBaseDmg
end
end
end
#鼠数儿:HitTenTimes(√)
class Battle::Move::HitTenTimes < Battle::Move
def multiHitMove?; return true; end
def pbNumHits(user, targets)
if user.hasActiveItem?(:LOADEDDICE)
if @battle.field.terrain == :Bugy && user.affectedByTerrain?
200.times { puts (5 + rand(7)) }
return 5 + rand(7)
else
return 4 + rand(7)
end
end
if @battle.field.terrain == :Bugy && user.affectedByTerrain?
return 11
else
return 10
end
end
def successCheckPerHit?
return @accCheckPerHit
end
def pbOnStartUse(user, targets)
@accCheckPerHit = !user.hasActiveAbility?(:SKILLLINK) && !user.hasActiveItem?(:LOADEDDICE)
end
end
#机变骰子:Loaded Dice(√)
class Battle::Move::HitTwoToFiveTimes < Battle::Move
alias paldea_pbNumHits pbNumHits
def pbNumHits(user, targets)
if user.hasActiveItem?(:LOADEDDICE)
if @battle.field.terrain == :Bugy && user.affectedByTerrain?
return 5 + rand(2)
else
return 4 + rand(2)
end
end
return paldea_pbNumHits(user, targets)
end
end
#秘蕈制造者
Battle::AbilityEffects::OnSwitchIn.add(:BUGYSURGE,
proc { |ability, battler, battle, switch_in|
next if battle.field.terrain == :Bugy
battle.pbShowAbilitySplash(battler)
battle.pbStartTerrain(battler, :Bugy)
# NOTE: The ability splash is hidden again in def pbStartTerrain.
}
)