主页
论坛
新帖
最新消息
新帖
最新动态
制作互助群
登录
注册
Toggle sidebar
Toggle sidebar
菜单
安装应用
安装
回复主题
【进站必读】宝可饭堂社区全局规定v1.10
关于坚决维护同人创作社群秩序与共识的公告
论坛
独立开发
进阶教程
【新天气套组】黑夜套组分享
禁用JavaScript。为了获得更好的体验,请在运行之前启用浏览器中的JavaScript。
您正在使用一款已经过时的浏览器!部分功能不能正常使用。
请尝试升级或使用
其他浏览器
。
信息
<blockquote data-quote="韩英鑫1111" data-source="post: 2961" data-attributes="member: 2566"><p>[CODE=ruby] #2-2.2:子午夜(√)</p><p> #2-2.2.1:催眠术必定命中且睡眠时间固定为4回合(√)</p><p> #写在SleepTargetHypnosis</p><p> #PBS文件里记得改催眠术的FunctionCode为SleepTargetHypnosis</p><p> class Battle::Move::SleepTargetHypnosis < Battle::Move</p><p> def canMagicCoat?</p><p> return true</p><p> end</p><p></p><p> def pbBaseAccuracy(user, target)</p><p> case target.effectiveWeather</p><p> when :Midnight</p><p> return 0</p><p> end</p><p> return super</p><p> end</p><p> </p><p> def pbFailsAgainstTarget?(user, target, show_message)</p><p> return false if damagingMove?</p><p> return !target.pbCanSleep?(user, show_message, self)</p><p> end</p><p> </p><p> def pbEffectAgainstTarget(user, target)</p><p> return if damagingMove?</p><p> target.pbSleep</p><p> end</p><p> </p><p> def pbAdditionalEffect(user, target)</p><p> return if target.damageState.substitute</p><p> target.pbSleep if target.pbCanSleep?(user, false, self)</p><p> end</p><p> end</p><p> #写在pbSleepDuration</p><p> def pbSleepDuration(duration = -1)</p><p> duration = 2 + @battle.pbRandom(3) if duration <= 0</p><p> duration = 5 if effectiveWeather == :Midnight</p><p> duration = (duration / 2).floor if hasActiveAbility?(:EARLYBIRD)</p><p> return duration</p><p> end</p><p> #2-2.2.2:大声咆哮强制解除睡眠且令对手混乱(√)</p><p> #写在LowerTargetSpAtk1</p><p> #PBS文件里记得改大声咆哮的FunctionCode为LowerTargetSpAtk1Snarl</p><p> class Battle::Move::LowerTargetSpAtk1Snarl < Battle::Move::TargetStatDownMove</p><p> def initialize(battle, move)</p><p> super</p><p> @statDown = [:SPECIAL_ATTACK, 1]</p><p> end</p><p></p><p> def pbEffectAfterAllHits(user, target)</p><p> if user.effectiveWeather == :Midnight</p><p> return if target.fainted?</p><p> return if target.damageState.unaffected || target.damageState.substitute</p><p> return if target.status != :SLEEP</p><p> target.pbCureStatus</p><p> if target.pbCanConfuse?(user, false, self)</p><p> target.pbConfuse</p><p> end</p><p> end</p><p> end</p><p> end</p><p> #2-2.2.3:食梦吸血3/4且对恶系也能造成伤害(√)</p><p> #写在HealUserByHalfOfDamageDoneIfTargetAsleep</p><p> #PBS文件里记得改食梦的FunctionCode为HealUserByHalfOfDamageDoneIfTargetAsleepDreamEater</p><p> class Battle::Move::HealUserByHalfOfDamageDoneIfTargetAsleepDreamEater < Battle::Move</p><p> def healingMove?; return Settings::MECHANICS_GENERATION >= 6; end</p><p> </p><p> def pbFailsAgainstTarget?(user, target, show_message)</p><p> if !target.asleep?</p><p> @battle.pbDisplay(_INTL("对于{1},完全没有效果!", target.pbThis)) if show_message</p><p> return true</p><p> end</p><p> return false</p><p> end</p><p> </p><p> def pbCalcTypeModSingle(moveType, defType, user, target)</p><p> return Effectiveness::NORMAL_EFFECTIVE_MULTIPLIER if defType == :DARK && user.effectiveWeather == :Midnight</p><p> return super</p><p> end</p><p> </p><p> def pbEffectAgainstTarget(user, target)</p><p> return if target.damageState.hpLost <= 0</p><p> if user.effectiveWeather == :Midnight</p><p> hpGain = (target.damageState.hpLost * 3 / 4.0).round</p><p> else </p><p> hpGain = (target.damageState.hpLost / 2.0).round</p><p> end</p><p> user.pbRecoverHPFromDrain(hpGain, target)</p><p> end</p><p> end</p><p></p><p> #2-2.3:惊魂夜(√)</p><p> #2-2.3.1:影子分身额外扣血1/8召唤替身(√)</p><p> #写在RaiseUserEvasion1</p><p> #PBS文件里记得改影子分身的FunctionCode为RaiseUserEvasion1DoubleTeam</p><p> class Battle::Move::RaiseUserEvasion1DoubleTeam < Battle::Move::StatUpMove</p><p> def initialize(battle, move)</p><p> super</p><p> @statUp = [:EVASION, 1]</p><p> end</p><p> </p><p> def canSnatch?</p><p> return true</p><p> end</p><p> </p><p> def pbMoveFailed?(user, targets)</p><p> if user.effectiveWeather == :ScaryNight</p><p> if user.effects[PBEffects::Substitute] > 0</p><p> @battle.pbDisplay(_INTL("{1}的分身已经出现了。", user.pbThis))</p><p> return true</p><p> end</p><p> @lifeCost = [(user.totalhp / 8).ceil, 1].max</p><p> @subLife = [(user.totalhp / 4).ceil, 1].max</p><p> if user.hp <= @lifeCost</p><p> @battle.pbDisplay(_INTL("但是,已经没有力气再分身了!"))</p><p> return true</p><p> end</p><p> return false</p><p> end</p><p> end</p><p> </p><p> def pbOnStartUse(user, targets)</p><p> if user.effectiveWeather == :ScaryNight</p><p> user.pbReduceHP(@lifeCost, false, false)</p><p> user.pbItemHPHealCheck</p><p> end</p><p> end</p><p> </p><p> def pbEffectGeneral(user)</p><p> if user.effectiveWeather == :ScaryNight</p><p> user.effects[PBEffects::Trapping] = 0</p><p> user.effects[PBEffects::TrappingMove] = nil</p><p> user.effects[PBEffects::Substitute] = @subLife</p><p> @battle.pbDisplay(_INTL("{1}的替身出现了!", user.pbThis))</p><p> end</p><p> super</p><p> end</p><p> end</p><p> #2-2.3.2:影子球AOE且根据攻击较强、防御较弱的一项计算(√)</p><p> #写在LowerTargetSpDef1</p><p> #PBS文件里记得改暗影球的FunctionCode为LowerTargetSpDef1ShadowBall</p><p> class Battle::Move::LowerTargetSpDef1ShadowBall < Battle::Move::TargetStatDownMove</p><p> def initialize(battle, move)</p><p> super</p><p> @statDown = [:SPECIAL_DEFENSE, 1]</p><p> @calcCategory = 1</p><p> end</p><p></p><p> def pbTarget(user)</p><p> if user.effectiveWeather == :ScaryNight</p><p> return GameData::Target.get(:AllNearFoes)</p><p> end</p><p> return super</p><p> end</p><p></p><p> def physicalMove?(thisType = nil); return (@calcCategory == 0); end</p><p> def specialMove?(thisType = nil); return (@calcCategory == 1); end</p><p> def contactMove?; return physicalMove?; end</p><p> </p><p> def pbOnStartUse(user, targets)</p><p> if user.effectiveWeather == :ScaryNight</p><p> target = targets[0]</p><p> return if !target</p><p> max_stage = Battle::Battler::STAT_STAGE_MAXIMUM</p><p> stageMul = Battle::Battler::STAT_STAGE_MULTIPLIERS</p><p> stageDiv = Battle::Battler::STAT_STAGE_DIVISORS</p><p> # Calculate user's effective attacking values</p><p> attack_stage = user.stages[:ATTACK] + max_stage</p><p> real_attack = (user.attack.to_f * stageMul[attack_stage] / stageDiv[attack_stage]).floor</p><p> special_attack_stage = user.stages[:SPECIAL_ATTACK] + max_stage</p><p> real_special_attack = (user.spatk.to_f * stageMul[special_attack_stage] / stageDiv[special_attack_stage]).floor</p><p> # Calculate target's effective defending values</p><p> defense_stage = target.stages[:DEFENSE] + max_stage</p><p> real_defense = (target.defense.to_f * stageMul[defense_stage] / stageDiv[defense_stage]).floor</p><p> special_defense_stage = target.stages[:SPECIAL_DEFENSE] + max_stage</p><p> real_special_defense = (target.spdef.to_f * stageMul[special_defense_stage] / stageDiv[special_defense_stage]).floor</p><p> # Perform simple damage calculation</p><p> physical_damage = real_attack.to_f / real_defense</p><p> special_damage = real_special_attack.to_f / real_special_defense</p><p> # Determine move's category</p><p> if physical_damage == special_damage</p><p> @calcCategory = (@battle.command_phase) ? rand(2) : @battle.pbRandom(2)</p><p> else</p><p> @calcCategory = (physical_damage > special_damage) ? 0 : 1</p><p> end</p><p> end</p><p> end</p><p> end</p><p> #2-2.3.3:鬼火可以使火系宝可梦烧伤(√)</p><p> #写在第一个Type immunities</p><p> when :BURN</p><p> if !(user&.effectiveWeather == :ScaryNight && move&.id== :WILLOWISP)</p><p> hasImmuneType |= pbHasType?(:FIRE)[/CODE]</p></blockquote><p></p>
[QUOTE="韩英鑫1111, post: 2961, member: 2566"] [CODE=ruby] #2-2.2:子午夜(√) #2-2.2.1:催眠术必定命中且睡眠时间固定为4回合(√) #写在SleepTargetHypnosis #PBS文件里记得改催眠术的FunctionCode为SleepTargetHypnosis class Battle::Move::SleepTargetHypnosis < Battle::Move def canMagicCoat? return true end def pbBaseAccuracy(user, target) case target.effectiveWeather when :Midnight return 0 end return super end def pbFailsAgainstTarget?(user, target, show_message) return false if damagingMove? return !target.pbCanSleep?(user, show_message, self) end def pbEffectAgainstTarget(user, target) return if damagingMove? target.pbSleep end def pbAdditionalEffect(user, target) return if target.damageState.substitute target.pbSleep if target.pbCanSleep?(user, false, self) end end #写在pbSleepDuration def pbSleepDuration(duration = -1) duration = 2 + @battle.pbRandom(3) if duration <= 0 duration = 5 if effectiveWeather == :Midnight duration = (duration / 2).floor if hasActiveAbility?(:EARLYBIRD) return duration end #2-2.2.2:大声咆哮强制解除睡眠且令对手混乱(√) #写在LowerTargetSpAtk1 #PBS文件里记得改大声咆哮的FunctionCode为LowerTargetSpAtk1Snarl class Battle::Move::LowerTargetSpAtk1Snarl < Battle::Move::TargetStatDownMove def initialize(battle, move) super @statDown = [:SPECIAL_ATTACK, 1] end def pbEffectAfterAllHits(user, target) if user.effectiveWeather == :Midnight return if target.fainted? return if target.damageState.unaffected || target.damageState.substitute return if target.status != :SLEEP target.pbCureStatus if target.pbCanConfuse?(user, false, self) target.pbConfuse end end end end #2-2.2.3:食梦吸血3/4且对恶系也能造成伤害(√) #写在HealUserByHalfOfDamageDoneIfTargetAsleep #PBS文件里记得改食梦的FunctionCode为HealUserByHalfOfDamageDoneIfTargetAsleepDreamEater class Battle::Move::HealUserByHalfOfDamageDoneIfTargetAsleepDreamEater < Battle::Move def healingMove?; return Settings::MECHANICS_GENERATION >= 6; end def pbFailsAgainstTarget?(user, target, show_message) if !target.asleep? @battle.pbDisplay(_INTL("对于{1},完全没有效果!", target.pbThis)) if show_message return true end return false end def pbCalcTypeModSingle(moveType, defType, user, target) return Effectiveness::NORMAL_EFFECTIVE_MULTIPLIER if defType == :DARK && user.effectiveWeather == :Midnight return super end def pbEffectAgainstTarget(user, target) return if target.damageState.hpLost <= 0 if user.effectiveWeather == :Midnight hpGain = (target.damageState.hpLost * 3 / 4.0).round else hpGain = (target.damageState.hpLost / 2.0).round end user.pbRecoverHPFromDrain(hpGain, target) end end #2-2.3:惊魂夜(√) #2-2.3.1:影子分身额外扣血1/8召唤替身(√) #写在RaiseUserEvasion1 #PBS文件里记得改影子分身的FunctionCode为RaiseUserEvasion1DoubleTeam class Battle::Move::RaiseUserEvasion1DoubleTeam < Battle::Move::StatUpMove def initialize(battle, move) super @statUp = [:EVASION, 1] end def canSnatch? return true end def pbMoveFailed?(user, targets) if user.effectiveWeather == :ScaryNight if user.effects[PBEffects::Substitute] > 0 @battle.pbDisplay(_INTL("{1}的分身已经出现了。", user.pbThis)) return true end @lifeCost = [(user.totalhp / 8).ceil, 1].max @subLife = [(user.totalhp / 4).ceil, 1].max if user.hp <= @lifeCost @battle.pbDisplay(_INTL("但是,已经没有力气再分身了!")) return true end return false end end def pbOnStartUse(user, targets) if user.effectiveWeather == :ScaryNight user.pbReduceHP(@lifeCost, false, false) user.pbItemHPHealCheck end end def pbEffectGeneral(user) if user.effectiveWeather == :ScaryNight user.effects[PBEffects::Trapping] = 0 user.effects[PBEffects::TrappingMove] = nil user.effects[PBEffects::Substitute] = @subLife @battle.pbDisplay(_INTL("{1}的替身出现了!", user.pbThis)) end super end end #2-2.3.2:影子球AOE且根据攻击较强、防御较弱的一项计算(√) #写在LowerTargetSpDef1 #PBS文件里记得改暗影球的FunctionCode为LowerTargetSpDef1ShadowBall class Battle::Move::LowerTargetSpDef1ShadowBall < Battle::Move::TargetStatDownMove def initialize(battle, move) super @statDown = [:SPECIAL_DEFENSE, 1] @calcCategory = 1 end def pbTarget(user) if user.effectiveWeather == :ScaryNight return GameData::Target.get(:AllNearFoes) end return super end def physicalMove?(thisType = nil); return (@calcCategory == 0); end def specialMove?(thisType = nil); return (@calcCategory == 1); end def contactMove?; return physicalMove?; end def pbOnStartUse(user, targets) if user.effectiveWeather == :ScaryNight target = targets[0] return if !target max_stage = Battle::Battler::STAT_STAGE_MAXIMUM stageMul = Battle::Battler::STAT_STAGE_MULTIPLIERS stageDiv = Battle::Battler::STAT_STAGE_DIVISORS # Calculate user's effective attacking values attack_stage = user.stages[:ATTACK] + max_stage real_attack = (user.attack.to_f * stageMul[attack_stage] / stageDiv[attack_stage]).floor special_attack_stage = user.stages[:SPECIAL_ATTACK] + max_stage real_special_attack = (user.spatk.to_f * stageMul[special_attack_stage] / stageDiv[special_attack_stage]).floor # Calculate target's effective defending values defense_stage = target.stages[:DEFENSE] + max_stage real_defense = (target.defense.to_f * stageMul[defense_stage] / stageDiv[defense_stage]).floor special_defense_stage = target.stages[:SPECIAL_DEFENSE] + max_stage real_special_defense = (target.spdef.to_f * stageMul[special_defense_stage] / stageDiv[special_defense_stage]).floor # Perform simple damage calculation physical_damage = real_attack.to_f / real_defense special_damage = real_special_attack.to_f / real_special_defense # Determine move's category if physical_damage == special_damage @calcCategory = (@battle.command_phase) ? rand(2) : @battle.pbRandom(2) else @calcCategory = (physical_damage > special_damage) ? 0 : 1 end end end end #2-2.3.3:鬼火可以使火系宝可梦烧伤(√) #写在第一个Type immunities when :BURN if !(user&.effectiveWeather == :ScaryNight && move&.id== :WILLOWISP) hasImmuneType |= pbHasType?(:FIRE)[/CODE] [/QUOTE]
验证
386-151=?
回复帖子
最新帖子
全
我想切换视角讲述故事
最新更新:全民制作人
星期三,21:43
开发问题
Z
将GBA打包成APK
最新更新:zheyeyeye
星期三,21:27
GBA教程
Z
【进站必读】宝可饭堂社区全局规定v1.10
最新更新:z1652646304
星期三,20:25
公告规定
雨
pokeemerald怎么改箱子数
最新更新:雨落天晴
星期二,10:16
开发问题
[讨论]什么契机导致你想做游戏的
最新更新:A原翼
星期一,00:12
其他相关讨论
论坛统计
主题
559
消息
2,422
成员
3,879
最新成员
stonezz
联系我们
QQ
2201858342
邮箱
pokefans@qq.com
论坛
独立开发
进阶教程
【新天气套组】黑夜套组分享
顶部