赞 | 4 |
VIP | 0 |
好人卡 | 0 |
积分 | 77 |
经验 | 15725 |
最后登录 | 2024-10-31 |
在线时间 | 1332 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 7714
- 在线时间
- 1332 小时
- 注册时间
- 2015-8-15
- 帖子
- 749
|
3楼
楼主 |
发表于 2023-4-10 14:22:32
|
只看该作者
- class Scene_Map
- #=======================================================
- # EFS 战斗模式
- # 1 : 混战 (阵形不可用,默认全军冲锋,默认出生点)
- # 2 : 正常阵形状 (正常有阵形,默认推进,默认出生点)
- # 3 : 伏击战 (守军士气大跌,被夹击包围,伏击出生点)
- # 4 : 攻城战 (守军站在墙上指定位置,攻方默认出生点,守军城墙点)
- # 5 : 巷战 (有居民助战和乱窜,攻方默认出生点,守方分队出生点)
- # 6 : 扫荡战 (抽取部分攻方打守方(每队5人内),混战,默认出生点)
-
- #=======================================================
- attr_accessor :player_controll
- attr_accessor :lisenter
- attr_accessor :group_lisenter
- attr_accessor :current_leader
- attr_accessor :efs_mode
- #attr_accessor :efs_winner
- attr_reader :efs_after_battle_level
- #--------------------------------------------------------
- # 开始EFS _update_efs
- #--------------------------------------------------------
- def start_efs(attacker,defender,mode = 1)
- #$game_system.bgm_memorize
-
-
- $game_screen.start_tone_change(Tone.new(-255,-255,-255), 20)
-
- play_anime(attacker,attacker.event.character_name + "-atk-1")
- play_anime(defender,defender.event.character_name + "-def")
-
- @efs_mode = mode
- @attacker = attacker
- @defender = defender
- #等待一会儿
- wait_a_moment(true)
-
- # 设置主角的透明状态
- $game_player.transparent = true
- #清除地图切换状态
- @map_changed = false
- #战略界面
- $game_switches[3] = false
- #刷新板子
- @winstatus.clean_my_actor
-
- update_windows
-
-
- =begin
- #交战(切换地图)
- load_or_map_data #记录旧的地图信息
- set_new_map_info(attacker,map_id)
- change_map #开始切换地图
- =end
-
- #交战(切换地图)
- engage(attacker,defender)
- #更新直到切换地图
- $game_system.update
- $game_screen.update
- $game_map.update
- change_map
- #切换地图
- transfer_player
-
-
- #设置对手
- attacker.set_target(defender)
- defender.set_target(attacker)
- #开始初始化
- #如果地图更改,则efs主初始化(攻击者、防御者、@efs模式)
- efs_main_initialize(attacker,defender,@efs_mode) if @map_changed
-
- #是否由玩家控制
- @player_controll = check_player_controll
-
-
- #根据战斗模式设置
-
-
- #初始队列 将它们分组
- group_them_up
-
- #各种刷新
- Graphics.update
- Input.update
- _update_efs
- #将画面聚焦到领导者
- # @现任领导人。kds如果是当前领导者!=无
- @current_leader.kds if @current_leader != nil
- #改变画面颜色
- $game_screen.start_tone_change(Tone.new(@efs_tone_R,@efs_tone_G,@efs_tone_B), 20)
- #等待一会儿
- wait_a_moment(true)
- #开启消息
- Notification.show
- #显示提示
- Graphics.tips("消灭敌人!")
- #$game_switches[10] = true
- #角色信息
- #@efs_character_bar.visible = true
- #@efs_character_bar.display_or_not
- #@efs_item_bar.visible = true
-
- #主循环Main loop for efs
- loop do #===============================↑战斗前
- #提示消息更新
- Notification.update
- #画面与输入的更新
- Graphics.update
- Input.update
- #更新EFS系统
- _update_efs #←战斗中
- #如果不在EFS就中断循环
- break unless $game_temp.inefs
- end #================================ ↓战斗后
-
- # @efs_character_bar.visible = false
- # @efs_item_bar.visible = false
-
- #改变画面颜色
- $game_screen.start_tone_change(Tone.new(@efs_tone_R,@efs_tone_G,@efs_tone_B), 20)
-
- #$game_system.bgm_restore
-
- #等待一会儿
- wait_a_moment(true)
-
-
- #战斗结束总评
- p "战斗结束总评 to be added"
-
- #@efs_winner =
-
-
- $game_system.bgm_play($game_system.battle_bgm)
-
-
- #清除双方的死亡士兵
- attacker.delete_all_dead
- defender.delete_all_dead
- #玩家控制 = false
- @player_controll = false
- #清空对手
- attacker.set_target(nil)
- defender.set_target(nil)
-
- # 设置主角的透明状态
- $game_player.transparent = false
- #开启战略菜单
- $game_switches[3] = true
- #更新窗口
- update_windows
- #更新画面
- Graphics.update
- $game_system.update
- $game_screen.update
- $game_map.update
-
- # 演奏战斗 BGM
- #$game_system.bgm_play($game_system.battle_bgm)
-
- end
- #--------------------------------------------------------
- # 开始EFS 在非SLG情况下 _update_efs
- #--------------------------------------------------------
- def start_efs_nonslg(attacker,defender,map_id,mode = 2,bool = false,for_titile = false)
- @efs_story_mode = bool
- if bool
- $game_switches[3] = false
- $game_switches[6] = true
- $game_switches[10] = false
- #Notification.pause = true
- end
- # 记忆主角行走图
- @role_walk_graphic = $game_player.character_name
- # 生成光标
- $game_player.character_name = Wzj::CURSOR
-
-
- $game_screen.start_tone_change(Tone.new(-255,-255,-255), 20)
- @efs_mode = mode
- @attacker = attacker
- @defender = defender
-
- # 设置主角的透明状态
- $game_player.transparent = true
-
- #清除地图切换状态
- @map_changed = false
- #交战(切换地图)
- load_or_map_data #记录旧的地图信息
- set_new_map_info(attacker,map_id)
- change_map #开始切换地图
- #更新直到切换地图
- $game_system.update
- $game_screen.update
- $game_map.update
- change_map
- #切换地图
- transfer_player
- #设置对手
- attacker.set_target(defender)
- defender.set_target(attacker)
- #开始初始化
- efs_main_initialize(attacker,defender,@efs_mode) if @map_changed
-
- #是否由玩家控制
- @player_controll = check_player_controll
- group_them_up #注意是否是战斗移动部分
- #各种刷新
- Graphics.update
- Input.update
- _update_efs
- #将画面聚焦到领导者
- @current_leader.kds if @current_leader != nil
- #改变画面颜色
- $game_screen.start_tone_change(Tone.new(@efs_tone_R,@efs_tone_G,@efs_tone_B), 20)
- #等待一会儿
- wait_a_moment(true)
- #开启消息
- Notification.hide if @efs_story_mode
-
- #主循环Main loop for efs
- loop do #===============================↑战斗前
- #提示消息更新
- Notification.update
- #画面与输入的更新
- Graphics.update
- Input.update
- #更新EFS系统
- _update_efs #←战斗中
- #如果不在EFS就中断循环
- break if ! $game_temp.inefs or $scene != self
- end #================================ ↓战斗后
-
-
- #改变画面颜色
- $game_screen.start_tone_change(Tone.new(@efs_tone_R,@efs_tone_G,@efs_tone_B), 20)
-
- #等待一会儿
- wait_a_moment(true)
-
- #清除双方的死亡士兵
- attacker.delete_all_dead
- defender.delete_all_dead
- #玩家控制 = false
- @player_controll = false
- #清空对手
- attacker.set_target(nil)
- defender.set_target(nil)
-
- # 设置主角的透明状态
- $game_player.transparent = false
-
- $game_player.character_name = @role_walk_graphic
-
-
- #更新画面
- Graphics.update
- $game_system.update
- $game_screen.update
- $game_map.update
-
- @efs_story_mode = false
-
- end
- #--------------------------------------------------------
- # 设置新地图信息
- #--------------------------------------------------------
- def set_new_map_info(attacker,new_map)
- #计算各种坐标
- b = load_data("Data/MapInfos.rxdata")[new_map].name.split(";")
- o0 = [b[1].split(",")[0].to_i,b[1].split(",")[1].to_i]
- o1 = [b[2].split(",")[0].to_i,b[2].split(",")[1].to_i]
- e0 = [b[3].split(",")[0].to_i,b[3].split(",")[1].to_i]
- e1 = [b[4].split(",")[0].to_i,b[4].split(",")[1].to_i]
- if attacker.player_team
- @target_x = (o0[0]+o1[0])/2
- @target_y = (o0[1]+o1[1])/2
- @e_target_x = (e0[0]+e1[0])/2
- @e_target_y = (e0[1]+e1[1])/2
- else
- @e_target_x = (o0[0]+o1[0])/2
- @e_target_y = (o0[1]+o1[1])/2
- @target_x = (e0[0]+e1[0])/2
- @target_y = (e0[1]+e1[1])/2
- end
- #目标地图
- @target_map_id = new_map
- #计算方向
-
-
- @target_d = get_d_toward(@target_x,@target_y,@e_target_x,@e_target_y)
- @e_target_d = get_d_toward(@e_target_x,@e_target_y,@target_x,@target_y)
-
-
- end
- #--------------------------------------------------------
- # EFS系统:刷新游戏
- #--------------------------------------------------------
- def _update_efs
- #-----------------------------------------------
- #UI更新
- #@efs_character_bar.update
- #@efs_item_bar.update
-
- #画面、地图刷新
- $game_system.update
- $game_screen.update
- $game_map.update
- #各种刷新
- @spriteset.update
- @message_window.update
-
- #各种场合
- if @efs_victory or @efs_all_dead or @efs_escape
- efs_battle_end
- return
- end
-
- #---------------------------------------------------
- # @@@@↓主内容↓@@@@@
- #---------------------------------------------------
-
- @group_think_counter += 1
- #我军群组s思考
- efs_team_think
- #敌军群组s思考
- efs_enermy_think
-
-
-
-
-
- #---------------------------------------------------
- #如果有窗户显示啥也不做
- return if $game_temp.message_window_showing or $game_temp.inefs == false
- # 事件解释器在执行则返回
- # return if @xn_srpg_interpreter.running?
- #---------------------------------------------------
-
- # 刷新EFS输入
- _update_efs_input
-
-
- end
-
-
- #--------------------------------------------------------
- # EFS系统:己方思考
- #--------------------------------------------------------
- #暂时使用最近的敌人当作目标
- def efs_team_think
-
- return if @group_think_counter < @group_think_period
- for team in @team_groups
- next if team.captain==nil
- team.update_morale
- zhansun = team.get_zhansun_inbattle
- #next if team.group_move_type == 4
- next if team.group_move_type == 3 or team.group_move_type == 4
-
- return if @player_controll
-
-
- list = []
- for enermy in @enermy_groups
- next if enermy.captain == nil
- x1=team.captain.x
- y1=team.captain.y
- x2=enermy.captain.x
- y2=enermy.captain.y
- list.push juli(x1,y1,x2,y2)
- end
- team.set_target(@enermy_groups[list.index(list.min)])
-
- arrow_hit_num = team.get_num_hit_by_missile
- reach_arrow_limit = arrow_hit_num > 5
-
-
- case team.group_type
- when 0
- if team.check_engage(list.min) or zhansun <= 0.8 or reach_arrow_limit
- team.charge
- else
- team.advance_forward
- end
- when 1
- if team.check_engage(list.min) or zhansun <= 0.8 or reach_arrow_limit
- team.charge
- else
- team.advance_forward
- end
- when 2
- if zhansun <= 0.5 or reach_arrow_limit
- team.charge
- else
- team.advance_forward
- end
- when 3
- if zhansun <= 0.65 or reach_arrow_limit
- team.charge
- else
- team.advance_forward
- end
- when 4
- if team.check_engage(list.min) or reach_arrow_limit
- team.charge
- else
- team.advance_forward
- end
- when 5
- if team.check_engage(list.min)
- #team.charge
- elsif zhansun <= 0.8 or reach_arrow_limit
- team.charge
- else
- team.advance_forward
- end
- else
- if team.check_engage(list.min) or zhansun <= 0.8 or reach_arrow_limit
- team.charge
- else
- team.advance_forward
- end
- end
-
-
-
- end
-
-
-
-
- end
- #--------------------------------------------------------
- # EFS系统:敌人方思考
- #--------------------------------------------------------
- def efs_enermy_think
- return if @group_think_counter < @group_think_period
- @group_think_counter = 0
-
- for team in @enermy_groups
-
- next if team.captain==nil
-
- team.update_morale
-
- arrow_hit_num = team.get_num_hit_by_missile
- reach_arrow_limit = arrow_hit_num > 5
- #team.reduce_num_hit_by_missile
-
-
-
- zhansun = team.get_zhansun_inbattle
- next if team.group_move_type == 3 or team.group_move_type == 4
- #next if team.group_move_type == 4
- list = []
- for enermy in @team_groups
- next if enermy.captain == nil
- x1=team.captain.x
- y1=team.captain.y
- x2=enermy.captain.x
- y2=enermy.captain.y
- list.push juli(x1,y1,x2,y2)
- end
-
-
- team.set_target(@team_groups[list.index(list.min)])
-
-
- # if team.check_engage(list.min) or zhansun <= 0.8
- #p team.group_type
-
- case team.group_type
- when 0
- if team.check_engage(list.min) or zhansun <= 0.8 or reach_arrow_limit
- team.charge
- else
- team.advance_forward
- end
- when 1
- if team.check_engage(list.min) or zhansun <= 0.8 or reach_arrow_limit
- team.charge
- else
- team.advance_forward
- end
- when 2
- if zhansun <= 0.5 or reach_arrow_limit
- team.charge
- else
- team.advance_forward
- end
- when 3
- if zhansun <= 0.65 or reach_arrow_limit
- team.charge
- else
- team.advance_forward
- end
- when 4
-
- if team.check_engage(list.min) or reach_arrow_limit
- team.charge
- else
- team.advance_forward
- end
-
- when 5
-
- if team.check_engage(list.min) or reach_arrow_limit
- #team.charge
- elsif zhansun <= 0.8
- team.charge
- else
- team.advance_forward
- end
-
- end
-
-
-
-
- end
-
-
- end
-
- #--------------------------------------------------------------------------
- # ● 判断全灭
- #--------------------------------------------------------------------------
- def check_losing
- @team_groups.each do |team|
- team.fighter.each do |f|
- return unless f.dead? or f.removed
- end
- end
- @efs_all_dead = true
- end
- #--------------------------------------------------------------------------
- # ● 判断胜利
- #--------------------------------------------------------------------------
- def check_winning
- @enermy_groups.each do |e|
- e.fighter.each do |f|
- return unless f.dead? or f.removed
- end
- end
- @efs_victory = true
- end
-
- def change_fighter_move_type
- @team_groups.each do |team|
- team.fighter.each do |f|
- next if f.dead?
- f.move_type = 5
- f.move_frequency = 3
- end
- end
- @enermy_groups.each do |e|
- e.fighter.each do |f|
- next if f.dead?
- f.move_type = 5
- f.move_frequency = 3
- end
- end
-
- end
-
-
- def display_battle_end_message
- if @efs_victory
- Notification.post("战斗胜利... 按下Tab键返回")
- #$game_system.me_play($game_system.battle_end_me)
- elsif @efs_all_dead
- Notification.post("战斗失败... 按下Tab键返回")
- #$game_system.me_play($data_system.gameover_me)
- else
- Notification.post("全军撤退... 按下Tab键返回")
- #$game_system.se_play($game_system.escape_se)
- end
- end
- #--------------------------------------------------------
- # EFS系统:战后处理
- #--------------------------------------------------------
- def efs_battle_end
-
- #unless $game_temp.inslg
- if @efs_story_mode or $强制返回 != nil
- efs_battle_end_nonslg
- return
- end
- #Audio.me_play(filename[, volume[, pitch]])
-
-
-
- counter_message = 0
-
- #displaying message
- display_battle_end_message
- if @efs_victory
- $game_system.me_play($game_system.battle_end_me)
- elsif @efs_all_dead
- $game_system.me_play($data_system.gameover_me)
- else
- $game_system.se_play($game_system.escape_se)
- end
-
-
- change_fighter_move_type
-
- loop do
- #updating every thing
- $game_system.update
- $game_screen.update
- $game_map.update
- Notification.update
- Graphics.update
- Input.update
- _update_efs_input
- @spriteset.update
- @message_window.update
- #displaying message
- counter_message+=1
- if counter_message >= 40*7
- display_battle_end_message
- counter_message = 0
- end
- #if Tab is pressed
- if Kboard.keyboard($R_Key_TAB)
-
-
-
- #p "战斗结束界面 to be added"
-
- @efs_after_battle_level = judge_battle_level
- p Wzj::EFS_AFTER_BATTLE_TEXT[@efs_after_battle_level]
-
-
- after_battle_statistics
-
- $game_screen.start_tone_change(Tone.new(-255,-255,-255), 20)
- wait_a_moment(true)
- $game_switches[5] = false
- $game_switches[6] = false
- back_to_map
- $game_temp.inefs = false
- break
- end
-
- end
-
-
- end
-
- #--------------------------------------------------------
- # EFS系统:战后处理
- #--------------------------------------------------------
- def efs_battle_end_nonslg
- change_fighter_move_type
-
- #loop do
- $game_system.update
- $game_screen.update
- $game_map.update
- Notification.update
- Graphics.update
- Input.update
- _update_efs_input
- @spriteset.update
- @message_window.update
-
- #end
- $game_screen.start_tone_change(Tone.new(-255,-255,-255), 20)
- wait_a_moment
- $game_switches[5] = false
- $game_switches[6] = false
- #$game_switches[10] = false
- back_to_map
- $game_temp.inefs = false
- end
-
-
-
- #--------------------------------------------------------
- # 判断胜利级别
- # 0 一败涂地
- # 1 一败涂地
- # 2 一败涂地
- # 3 寡不敌众
- # 4 血战惜败
- # 5 不相上下
- # 6 血战险胜
- # 7 战果辉煌
- # 8 史诗大捷
- # 9 史诗大捷
- # 10史诗大捷
- #--------------------------------------------------------
-
-
-
-
- def judge_battle_level
- team_sum = 0
- enermy_sum = 0
- @team_groups.each do |groups|
- team_sum += groups.alive_while_starting
- end
- @enermy_groups.each do |groups|
- enermy_sum += groups.alive_while_starting
- end
- team_down = 0
- enermy_down = 0
- for f in $game_map.fighters.values
- if f.team == 1
- if f.dead?
- team_down += 1
- end
- else#========
- if f.dead?
- enermy_down += 1
- end
- end #if team
- end #do
- team_r = team_down.to_f/team_sum
- enermy_r = enermy_down.to_f/enermy_sum
- if @efs_victory
- score = (5-team_r*5+enermy_r*5).round
- score = [[score,6].max,10].min
- else
-
- score = 10 - (team_r*5+ 5-enermy_r*5).round
- score = [[score,0].max,4].min
- end
- return score
- end
-
-
- #--------------------------------------------------------
- # 功能函数 :战后统计 实用度:★★
- #--------------------------------------------------------
- def after_battle_statistics
- team_dead = 0
- enermy_dead = 0
- team_wound = 0
- enermy_wound = 0
- team_retreat = 0
- enermy_retreat = 0
-
- for f in $game_map.fighters.values
- if f.team == 1
- if f.removed
- team_retreat+=1
- next
- elsif f.dead?
- if f.killed
- team_dead += 1
- else
- team_wound += 1
- end
- next
- end
- else#========
- if f.removed
- enermy_retreat+=1
- next
- elsif f.dead?
- if f.killed
- enermy_dead += 1
- else
- enermy_wound += 1
- end
- next
- end
- end #if team
- end #do
- Notification.post("我军阵亡:"+team_dead.to_s)
- Notification.post("我军受伤:"+team_wound.to_s)
- Notification.post("我军撤退:"+team_retreat.to_s)
- Notification.post("敌军阵亡:"+enermy_dead.to_s)
- Notification.post("敌军受伤:"+enermy_wound.to_s)
- Notification.post("敌军撤退:"+enermy_retreat.to_s)
-
- end#def
- #--------------------------------------------------------
- # 移除死亡士兵 ★★★★★
- #--------------------------------------------------------
- def delete_dead_fighter
-
-
-
-
- end
-
- #--------------------------------------------------------
- # 功能函数 :求两点间的距离 实用度:★★★★★
- #--------------------------------------------------------
- def juli(x1, y1, x2, y2)
- return (x1 - x2).abs + (y1 - y2).abs
- end
-
-
-
-
- #--------------------------------------------------------
- # 自动战斗 实用度:★★★
- #--------------------------------------------------------
- def efs_auto_battle(attacker, defender)
- #战前补充
- attacker.refill
- defender.refill
-
- a_hp=0
- a_shd=0
- a_armor=0
- a_a_skill=0
- a_d_skill=0
- a_base_atk=0
- a_bro_atk=0
- a_anti_cav=0
- a_anti_inf=0
- a_charge=0
-
- a_num_inf=0
- a_num_cav=0
-
-
-
- attacker.member.each do |group|
- group.fighter.each do |f|
-
- a_hp += f.hp
- a_shd += f.shd_hp
- a_armor += f.armor_hp
- a_a_skill+= f.atk_skill
- a_d_skill+= f.def_skill
- a_anti_cav+= f.anti_cav
- a_anti_inf+= f.anti_inf
- a_charge+= f.charge_boun
-
- case f.class
- when EFS_Hero
- a_num_inf+=1
- a_base_atk+= f.base_atk
- a_bro_atk+= f.bro_atk
- when EFS_Infantry
- a_num_inf+=1
- a_base_atk+= f.base_atk
- a_bro_atk+= f.bro_atk
- when EFS_Missile_Infantry
- a_num_inf+=1
- a_base_atk+= f.s_base_atk
- a_bro_atk+= f.s_bro_atk
- when EFS_Horseman
- a_num_cav+=1
- a_base_atk+= f.base_atk
- a_bro_atk+= f.bro_atk
- when EFS_Missile_Horse
- a_num_cav+=1
- a_base_atk+= f.s_base_atk
- a_bro_atk+= f.s_bro_atk
- when EFS_Object
-
- end
-
- end
- end
- attacker_hp=a_hp
- attacker_shd=a_shd
- attacker_armor=a_armor
- attacker_a_skill=a_a_skill
- attacker_d_skill=a_d_skill
- attacker_base_atk=a_base_atk
- attacker_bro_atk=a_bro_atk
- attacker_anti_cav=a_anti_cav
- attacker_anti_inf=a_anti_inf
- attacker_charge=a_charge
-
- attacker_num_inf=a_num_inf
- attacker_num_cav=a_num_cav
-
- a_hp=0
- a_shd=0
- a_armor=0
- a_a_skill=0
- a_d_skill=0
- a_base_atk=0
- a_bro_atk=0
- a_anti_cav=0
- a_anti_inf=0
- a_charge=0
-
- a_num_inf=0
- a_num_cav=0
-
-
-
- defender.member.each do |group|
- group.fighter.each do |f|
-
- a_hp += f.hp
- a_shd += f.shd_hp
- a_armor += f.armor_hp
- a_a_skill+= f.atk_skill
- a_d_skill+= f.def_skill
- a_anti_cav+= f.anti_cav
- a_anti_inf+= f.anti_inf
- a_charge+= f.charge_boun
-
- case f.class
- when EFS_Hero
- a_num_inf+=1
- a_base_atk+= f.base_atk
- a_bro_atk+= f.bro_atk
- when EFS_Infantry
- a_num_inf+=1
- a_base_atk+= f.base_atk
- a_bro_atk+= f.bro_atk
- when EFS_Missile_Infantry
- a_num_inf+=1
- a_base_atk+= f.s_base_atk
- a_bro_atk+= f.s_bro_atk
- when EFS_Horseman
- a_num_cav+=1
- a_base_atk+= f.base_atk
- a_bro_atk+= f.bro_atk
- when EFS_Missile_Horse
- a_num_cav+=1
- a_base_atk+= f.s_base_atk
- a_bro_atk+= f.s_bro_atk
- when EFS_Object
-
- end
-
- end
- end
- defender_hp=a_hp
- defender_shd=a_shd
- defender_armor=a_armor
- defender_a_skill=a_a_skill
- defender_d_skill=a_d_skill
- defender_base_atk=a_base_atk
- defender_bro_atk=a_bro_atk
- defender_anti_cav=a_anti_cav
- defender_anti_inf=a_anti_inf
- defender_charge=a_charge
-
- defender_num_inf=a_num_inf
- defender_num_cav=a_num_cav
- =begin
- attacker_hp=a_hp
- attacker_shd=a_shd
- attacker_armor=a_armor
- attacker_a_skill=a_a_skill
- attacker_d_skill=a_d_skill
- attacker_base_atk=a_base_atk
- attacker_bro_atk=a_bro_atk
- attacker_anti_cav=a_anti_cav
- attacker_anti_inf=a_anti_inf
- attacker_charge=a_charge
-
- attacker_num_inf=a_num_inf
- attacker_num_cav=a_num_cav
-
-
- =end
- attacker_damge_reduce = attacker_a_skill/(attacker_a_skill+defender_d_skill)
- defender_defende_reduce = defender_d_skill/(attacker_a_skill+defender_d_skill)
- sum_damage = attacker_bro_atk*attacker_damge_reduce
-
- sum_damage += (attacker_base_atk + attacker_charge)*attacker_damge_reduce
-
- sum_damage -= (defender_shd+defender_armor)*defender_defende_reduce
- result = sum_damage/(defender_num_inf+defender_num_cav)
- p result
-
-
- end
-
-
-
-
-
-
-
-
- end
复制代码 |
|