本帖最后由 布冷.逆天 于 2015-2-23 19:48 编辑
以解决,可是又有新问题了!解决的代码,这个代码直接导致死亡!我需要限制住交易后的血量,应该设置哪呀?- def reduce_hp
- reduce_hp = 1000
- reduce_hp = [reduce_hp,$game_party.actors[0].maxhp-=10].min
- if $game_party.actors[0].hp<=10
- print"你快死亡了!"
- else
- $game_party.actors[0].hp -= reduce_hp
- $game_party.gain_gold(reduce_hp*=10)
- print"交换完成!"
- end
- end
- end
复制代码def reduce_hp reduce_hp = 1000 reduce_hp = [reduce_hp,$game_party.actors[0].maxhp-=10].min if $game_party.actors[0].hp<=10 print"你快死亡了!" else $game_party.actors[0].hp -= reduce_hp $game_party.gain_gold(reduce_hp*=10) print"交换完成!" return [$game_party.actors[0].hp+=10,$game_party.lose_gold(10)] end end end
def reduce_hp
reduce_hp = 1000
reduce_hp = [reduce_hp,$game_party.actors[0].maxhp-=10].min
if $game_party.actors[0].hp<=10
print"你快死亡了!"
else
$game_party.actors[0].hp -= reduce_hp
$game_party.gain_gold(reduce_hp*=10)
print"交换完成!"
return [$game_party.actors[0].hp+=10,$game_party.lose_gold(10)]
end
end
end
|