Project1

标题: [以解决]EXPLOSION_SETTINGS[data_id] = [20,35,true]+个开关 [打印本页]

作者: 金芒芒    时间: 2024-8-8 08:01
标题: [以解决]EXPLOSION_SETTINGS[data_id] = [20,35,true]+个开关
本帖最后由 金芒芒 于 2024-8-8 18:22 编辑

@explosion_s =      Figter_data::EXPLOSION_SETTINGS[data_id]
第一个脚本是人物模型参数,第2个脚本是爆炸定义,第3个脚本是战斗是触发爆炸伤害  。 想要在人物模型第一个脚本43行加个18号开关 效果(EXPLOSION_SETTINGS[data_id] =(18号=开的时候) [20,35,true]


当18号开关开的时候EXPLOSION_SETTINGS[data_id] = [20,35,true]#第一个脚本角色模型43行不然EXPLOSION_SETTINGS[data_id] =nil
@explosion_s =      Figter_data::EXPLOSION_SETTINGS[data_id]  
EXPLOSION_SETTINGS[data_id] = [20,35,true]#第一个脚本角色模型43行

https://m.youku.com/video/id_XNj ... o_XMTMyMDQwMjI1Mg==

  
RUBY 代码复制
  1. module Figter_data
  2.  
  3. data_id = 13
  4. #=====基本、模型信息==========
  5. CHARACTER_NAME[data_id] = "夏侯渊"
  6. ATK_SE[data_id] = "spearbasic_0"
  7. ATK_SE_NUM[data_id] = 9
  8. DEF_SE[data_id] = nil
  9. DEF_SE_NUM[data_id] = nil
  10. S_ATK_SE[data_id] = "arrowbasic_"
  11. S_ATK_SE_NUM[data_id] = 14
  12. AMMO_NAME[data_id] = "Missile_CrossbowBolt"
  13. AMMO_D_NAME[data_id] = "DROP_CrossbowBolt"
  14. S_SHOOT_SE[data_id] = "cbow_0"
  15. S_SHOOT_SE_NUM[data_id] = 5
  16. S_PASSBY_SE[data_id] = "bolt_pass_0"
  17. S_PASSBY_SE_NUM[data_id] = 8
  18. S_DROP_SE[data_id] = "bolt_ground_0"
  19. S_DROP_SE_NUM[data_id] = 8
  20. S_FLY_TYPE[data_id] = 0
  21. #=======类别=================
  22. THE_NAME[data_id] = "帝国弩兵"
  23. IS_CAL[data_id]  =   false
  24. IS_ARC[data_id]  =   true
  25. HEAVY[data_id]  =    false
  26. LABEL[data_id] = 5
  27. DESCRIPTION[data_id] = "赫西帝国弩手,中装步兵,即使训练周期比弓箭手短,但是弩出色的穿透力使他们成为了帝国最优秀的射手。"
  28. #==========属性==============
  29. HP_MAX[data_id]  =   225
  30. AMMOR_HP[data_id]  = 20
  31. SHD_HP[data_id]  =   0
  32. BASE_ATK[data_id]  = 75
  33. BRO_ATK[data_id]  =  5
  34. S_BASE_ATK[data_id] = 165
  35. S_BRO_ATK[data_id]  = 80
  36. ATK_SKILL[data_id] = 20
  37. DEF_SKILL[data_id] = 5
  38. ANTI_CAV[data_id]  = 0
  39. ANTI_INF[data_id]  = 0
  40. CHARGE_BOUN[data_id]=20
  41. MORALE[data_id]  =   65    #100max
  42. CRITICAL_HIT[data_id] = 0
  43. EXPLOSION_SETTINGS[data_id] = [20,35,true] #nil
  44.  
  45. ATK_FR[data_id] = 8
  46. ATK_RANGE[data_id]  =  1
  47. ENGAGE_RANGE[data_id]  =  14
  48. ENGAGE_RANGE_MIN[data_id]  =  4
  49. MOVEMENT_SPEED[data_id]  =  2.5
  50. ACCURATCY[data_id]  = 85
  51.  
  52. LIVE_CHANCE[data_id]  = 20
  53. AMMO_MAX[data_id] = 18
  54.  
  55.  
  56. ATK_CODE[data_id] = nil
  57.  
  58. #===========战略用=============
  59. EXP[data_id]  =      6               
  60. PRICE[data_id]  =    275              
  61. EXP_NEED[data_id]  = 50              
  62. NEXT_LEVEL[data_id]  = []
  63. CAPTAIN_SKILL[data_id]  = 7
  64.  
  65.  
  66.  
  67. end

RUBY 代码复制
  1. class Scene_Map
  2.  
  3.   #--------------------------------------------------------
  4.   # ●爆炸 (中心X,中心Y,中心伤害,范围,动画ID,施放者,队伍不受(0是所有人受)是否留垃圾)
  5.   #--------------------------------------------------------  
  6. #定义 EFS爆炸(x,y,ini伤害,范围,动画id,施放者= 无,队伍 =0,垃圾=true)
  7.   def EFS_Explosion(x,y,ini_damage,range,animation_id,shifazhe = nil,team = 0,trash = true)
  8.     if trash#如果垃圾
  9.      #坑= 变魔术出现临时演员 (x,y,“垃圾”,“180-开关03”,8,1,错误)
  10.       keng = conjure_temp(x,y,"trash","180-Switch03",8,1,false)
  11.      #演 = 变魔术出现临时演员(x,y,“垃圾”,“197-支架05”,4,0,true)
  12.       yan = conjure_temp(x,y,"trash","197-Support05",4,0,true)
  13.     end
  14.    #事件=变出临时演员(x,y,“爆炸”,“”,2)
  15.     event = conjure_temp(x,y,"EXPLOSION","",2)
  16.     refresh_screen#刷新屏幕
  17.     event.animation_id = animation_id#事件动画id=动画id
  18.    # $游戏屏幕。开始抖动(功率(x,y,15,1),功率(x、y,20,1)、45)
  19.     $game_screen.start_shake(power(x,y,15,1),power(x,y,20,1),45)
  20.    #$游戏屏幕。启动闪光灯(新颜色(255255255,功率(x,y,100,4)),10)
  21.     $game_screen.start_flash(Color.new(255,255,255,power(x,y,100,4)), 10)
  22.     #对于$游戏地图中的f。战士.价值
  23.     for f in $game_map.fighters.values
  24.       #下一个if团队!=0和f.团队==团队
  25.       next if team != 0 and f.team == team
  26.       next if f.dead?#下一个如果f.死了?
  27.       f_juli = juli(f.x,f.y,x,y)
  28.       if f_juli <= range#范围
  29.        # 伤害=(范围-f_距离)*ini伤害/(范围+0.0)
  30.         damage =  (range-f_juli)*ini_damage/(range+0.0)
  31.         #自然_伤害(f,伤害,施放者,Wzj::ONFIRE_ANIMATION)#士兵着火动画
  32.         nature_damage(f,damage,shifazhe,Wzj::ONFIRE_ANIMATION)
  33.         f.zhafei(x,y,5) if damage >=25# f.施放者(x,y,5) if 伤害 >=25
  34.  
  35.       end
  36.  
  37.  
  38.     end
  39.  
  40.  
  41.     keng .animation_id = 123 #123坑。动画_id=123
  42.  
  43.  
  44.   end

RUBY 代码复制
  1. def damage_process_shoot(target)
  2.     target.show_temp_hpbar
  3.     target.try_dodge
  4.  
  5.     target.set_level_hit_by_missile(1)
  6.  
  7.     #执行特殊代码
  8.     eval(@atk_code) if @atk_code != nil
  9.  
  10.     #[4,99,true]
  11.     if @explosion_s != nil
  12.       target.set_level_hit_by_missile(4)
  13.        x = target.x
  14.        y = target.y
  15.        r = @explosion_s[0]
  16.        a = @explosion_s[1]
  17.        t = @explosion_s[2]
  18.        $scene.EFS_Explosion(x,y,@s_base_atk,r,a,self,@team,t)
  19.       return
  20.     end
  21.  
  22.     player_blocked = (target.is_a?(EFS_Hero) and target.p_blocked?(self))
  23.  
  24.     critical = false
  25.     temp_animation_id = Wzj::HIT_ANIMATION_ID   
  26.     return if target.dead?
  27.     d = target.direction
  28.     shd_armor_reduce = calculate_shd_armor_reduce(d)
  29.     if rand(100) < @critical_hit
  30.       damage_reduce = 1
  31.       target.animation_id=Wzj::HIT_ANIMATION_ID_2
  32.       critical = true
  33.     else
  34.       damage_reduce = calculate_damage_reduce(d)
  35.     end  
  36.     buodong = (rand(10)-5).round
  37.     #远程与近程攻击力转换
  38.     #######################
  39.     #破甲伤害计算
  40.     damage = @s_bro_atk
  41.     target.hp -=  damage*damage_reduce
  42.  
  43.  
  44.  
  45.  
  46.     if target.is_a?(EFS_Horseman)
  47.       damage = @s_base_atk+@anti_cav
  48.     else
  49.       damage = @s_base_atk+@anti_inf
  50.     end   
  51.  
  52.     #damage+= @charge_boun unless @rushed
  53.     #@rushed = true
  54.  
  55.     shd_armor = 0
  56.     if target.guard?
  57.     shd_armor = target.shd_hp_max * shd_armor_reduce
  58.     end
  59.     armor = shd_armor + target.armor_hp_max
  60.  
  61.     damage = [buodong+5,(damage-armor)*damage_reduce+buodong].max
  62.     #如果对方溃逃加成伤害
  63.     damage = 2*damage - damage/2 if target.move_type == 4
  64.  
  65.     #如果玩家格挡住
  66.     blocked = false
  67.     if player_blocked
  68.       #damage = 2*damage
  69.       if target.use_sp(damage)
  70.         blocked = true
  71.       else
  72.           r_damage = (damage - target.sp)/2
  73.           target.sp -= damage
  74.           target.hp -= r_damage
  75.       end  
  76.     else  
  77.       target.hp -=  damage
  78.     end  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.     if target.dead?
  85.       target.dead unless target.already_deal_dead
  86.       display_killing_msg(target)
  87.                   #获得经验
  88.       gain_exp(target.exp)
  89.     end  
  90.  
  91.     #闪烁动画
  92.      target.animation_id=temp_animation_id
  93.     #如果目标是玩家控制的英雄
  94.     if target.is_a?(EFS_Hero)
  95.       if blocked
  96.       shaker(5,5,15)
  97.       target.add_to_popup_list("Guard",false)
  98.       else
  99.       shaker(5,10,20)
  100.       unless target.hero_get_hit_se==nil
  101.       Audio.se_play("Audio/SE/"+target.hero_get_hit_se+ (rand(target.hero_get_hit_se_num)+1).to_s,100, 100)
  102.       end      
  103.       #Audio.se_play("Audio/SE/V_Damage"+ (rand(3)+1).to_s,100, 100)
  104.       $game_screen.start_flash(Color.new(255,0,0,100), 5)
  105.       target.add_to_popup_list(damage.round,critical)
  106.       target.add_to_popup_list("Critical",false,15) if critical
  107.       end  
  108.     end
  109.     #演奏SE  
  110.     if target.guard? and target.shd_hp > 0 and target.direction != @direction and target.def_se != nil
  111.     Audio.se_play("Audio/SE/"+target.def_se+ (rand(target.def_se_num)+1).to_s,se_v, 100)
  112.     else  
  113.     Audio.se_play("Audio/SE/"+@atk_se+ (rand(@atk_se_num)+1).to_s,se_v+20, 100)
  114.     end
  115.     #如果玩家挡住了
  116.     target.blocked if blocked
  117.  
  118.    end

作者: 金芒芒    时间: 2024-8-8 18:21
原来是在第三个脚本里修改定义




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1