class Interpreter
def enemy_battle
#各参数说明:X打开独立开关X;1结束游戏
#各参数说明:X打开独立开关X;1暂时消除事件
#怪物事件命名格式:
#Enemy+怪物编号+视野内移动+视野+视野外移动+主角死亡处理+事件死亡处理
evt = $game_map.events[@event_id]
eid = evt.event.name[5,3].to_i
ego = evt.event.name[11,1]
ekp = evt.event.name[12,1]
enemy = $data_enemies[eid]
player = $game_player
actor = $game_party.actors[0]
weapon = $data_weapons[actor.weapon_id]
battle_action(actor, enemy, player, evt)
actor.hp -= player.damage if not player.damage == "Miss"
if actor.hp <= 0
$game_system.se_play($data_system.actor_collapse_se)
if ego == "1"
$game_temp.gameover = true
else
$game_self_switches[[@map_id,@event_id,ego]] = true
$game_map.need_refresh = true
end
end
battle_action(enemy, actor, evt, player)
evt.hp -= evt.damage if not evt.damage == "Miss"
if evt.hp<=0
$game_system.se_play($data_system.enemy_collapse_se)
$game_party.gain_gold(enemy.gold)
actor.exp += enemy.exp
if rand(100)<enemy.treasure_prob
if enemy.item_id > 0
$game_party.gain_item(enemy.item_id, 1)
end
if enemy.weapon_id > 0
$game_party.gain_weapon(enemy.weapon_id, 1)
end
if enemy.armor_id > 0
$game_party.gain_armor(enemy.armor_id, 1)
end
end
if ekp == "1"
evt.erase
else
$game_self_switches[[@map_id,@event_id,ekp]] = true
$game_map.need_refresh = true
end
end
evt.direction_fix = false
evt.turn_toward_player
evt.direction_fix = true
end
def get_damage_p(p2,p1)
p1d = p1.direction
p2d = p2.direction
if p1d == p2d
case p1d
when 2
if p1.y < p2.y
return 4
else
return 1
end
when 4
if p1.x > p2.x
return 4
else
return 1
end
when 6
if p1.x < p2.x
return 4
else
return 1
end
when 8
if p1.y > p2.y
return 4
else
return 1
end
end
end
return 2
end
def battle_action(dmer, ater, evt, player)
dct_dmg = get_damage_p(evt, player)
if ater.is_a?(Game_Actor) and $game_switches[2]==true
skill = $data_skills[$game_variables[$game_party.actors[0].id+50]]
ater.sp -= skill.sp_cost
power = skill.power + ater.atk * skill.atk_f / 100
if power > 0
power -= dmer.pdef * skill.pdef_f / 200
power -= dmer.mdef * skill.mdef_f / 200
power += ater.int/2 + rand(ater.int/2)
power = [power, 0].max
————————————————————
应该是属于【战斗系统】一类的。。。。
我知道里面有一项是【角色死亡,游戏结束】