Project1
标题: 如何过段时间清除地图上的垃圾keng [打印本页]
作者: 金芒芒 时间: 2024-9-5 17:00
标题: 如何过段时间清除地图上的垃圾keng 本帖最后由 金芒芒 于 2024-9-7 09:06 编辑
class Scene_Map
#--------------------------------------------------------
# ●爆炸 (中心X,中心Y,中心伤害,范围,动画ID,施放者,队伍不受(0是所有人受)是否留垃圾)
#--------------------------------------------------------
#定义 EFS爆炸(x,y,ini伤害,范围,动画id,施放者= 无,队伍 =0,垃圾=true)
def EFS_Jinggongzhiniao( x,y,ini_damage,range,animation_id,shifazhe = nil ,team = 0 ,trash = true )
if trash#如果垃圾
#坑= 变魔术出现临时演员 (x,y,“垃圾”,“180-开关03”,8,1,错误)
keng = conjure_temp( x,y,"trash" ,"180-Switch03" ,8 ,1 ,false )
#演 = 变魔术出现临时演员(x,y,“垃圾”,“197-支架05”,4,0,true)
yan = conjure_temp( x,y,"trash" ,"197-Support05" ,4 ,0 ,true )
end
#事件=变出临时演员(x,y,“爆炸”,“”,2)
event = conjure_temp( x,y,"EXPLOSION" ,"" ,2 )
refresh_screen#刷新屏幕
event.animation_id = animation_id#事件动画id=动画id
# $游戏屏幕。开始抖动(功率(x,y,15,1),功率(x、y,20,1)、45)
$game_screen .start_shake ( power( x,y,15 ,1 ) ,power( x,y,20 ,1 ) ,45 )
#$游戏屏幕。启动闪光灯(新颜色(255255255,功率(x,y,100,4)),10)
$game_screen .start_flash ( Color.new ( 255 ,255 ,255 ,power( x,y,100 ,4 ) ) , 10 )
#对于$游戏地图中的f。战士.价值
for f in $game_map .fighters .values
#下一个if团队!=0和f.团队==团队
next if team != 0 and f.team == team
next if f.dead ?#下一个如果f.死了?
f_juli = juli( f.x ,f.y ,x,y)
if f_juli <= range#范围
# 伤害=(范围-f_距离)*中心伤害/(范围+0.0)
damage = ( range-f_juli) *ini_damage/( range+0.0 )
#自然_伤害(f,伤害,施放者,Wzj::ONFIRE_ANIMATION)#士兵着火动画
nature_damage( f,damage,shifazhe,Wzj::ONFIRE_ANIMATION )
f.zhafei ( x,y,5 ) if damage >=25 # f.施放者(x,y,5) if 伤害 >=25
end
end
keng .animation_id = 123 #123坑。动画_id=123
end
end
class Scene_Map
#--------------------------------------------------------
# ●爆炸 (中心X,中心Y,中心伤害,范围,动画ID,施放者,队伍不受(0是所有人受)是否留垃圾)
#--------------------------------------------------------
#定义 EFS爆炸(x,y,ini伤害,范围,动画id,施放者= 无,队伍 =0,垃圾=true)
def EFS_Jinggongzhiniao( x,y,ini_damage,range,animation_id,shifazhe = nil ,team = 0 ,trash = true )
if trash#如果垃圾
#坑= 变魔术出现临时演员 (x,y,“垃圾”,“180-开关03”,8,1,错误)
keng = conjure_temp( x,y,"trash" ,"180-Switch03" ,8 ,1 ,false )
#演 = 变魔术出现临时演员(x,y,“垃圾”,“197-支架05”,4,0,true)
yan = conjure_temp( x,y,"trash" ,"197-Support05" ,4 ,0 ,true )
end
#事件=变出临时演员(x,y,“爆炸”,“”,2)
event = conjure_temp( x,y,"EXPLOSION" ,"" ,2 )
refresh_screen#刷新屏幕
event.animation_id = animation_id#事件动画id=动画id
# $游戏屏幕。开始抖动(功率(x,y,15,1),功率(x、y,20,1)、45)
$game_screen .start_shake ( power( x,y,15 ,1 ) ,power( x,y,20 ,1 ) ,45 )
#$游戏屏幕。启动闪光灯(新颜色(255255255,功率(x,y,100,4)),10)
$game_screen .start_flash ( Color.new ( 255 ,255 ,255 ,power( x,y,100 ,4 ) ) , 10 )
#对于$游戏地图中的f。战士.价值
for f in $game_map .fighters .values
#下一个if团队!=0和f.团队==团队
next if team != 0 and f.team == team
next if f.dead ?#下一个如果f.死了?
f_juli = juli( f.x ,f.y ,x,y)
if f_juli <= range#范围
# 伤害=(范围-f_距离)*中心伤害/(范围+0.0)
damage = ( range-f_juli) *ini_damage/( range+0.0 )
#自然_伤害(f,伤害,施放者,Wzj::ONFIRE_ANIMATION)#士兵着火动画
nature_damage( f,damage,shifazhe,Wzj::ONFIRE_ANIMATION )
f.zhafei ( x,y,5 ) if damage >=25 # f.施放者(x,y,5) if 伤害 >=25
end
end
keng .animation_id = 123 #123坑。动画_id=123
end
end
mmexport1725671057833.png
(800.52 KB, 下载次数: 27)
mmexport1725671062169.png
(495.83 KB, 下载次数: 24)
作者: soulsaga 时间: 2024-9-6 19:40
找爱佬写的脚本吗?
看不明白
作者: 金芒芒 时间: 2024-9-7 08:18
本帖最后由 金芒芒 于 2024-9-7 11:02 编辑
魔法小肉包说对了 这个坑是个临时演员 打了几战还是在地图上,每使用一次魔法多个坑,这种效果我想要不过又坑坑洼洼的 又消失不掉 为了减少内存一张地图战场反复用,结果多是坑坑洼洼消除不掉
作者: soulsaga 时间: 2024-9-7 12:52
conjure_temp
这是什么用途的呢
作者: 金芒芒 时间: 2024-9-7 13:20
本帖最后由 金芒芒 于 2024-9-7 16:13 编辑
魔法击中目标的一个弹坑,战斗时候装饰场景用的
class EFS_Battler < Game_Character
@jinggongzhiniao_s = Figter_data::JINGONG_SETTINGS[data_id]
end
def damage_process_shoot( target) #伤害过程射击(目标)
target.show_temp_hpbar #目标。显示临时演员hp栏
target.try_dodge #目标。试着闪避
#导弹击中目标设定级别(1)
target.set_level_hit_by_missile ( 1 )
#执行特殊代码
eval ( @atk_code) if @atk_code != nil #eval(atk代码)if@atk代码!=无
# @jinggongzhiniao_s == nil
#[4,99,true]
if @jinggongzhiniao_s != nil #如果@爆炸技能!=无
#导弹击中目标设定级别(4)
target.set_level_hit_by_missile ( 4 )
x = target.x
y = target.y
q = @jinggongzhiniao_s [ 0 ]
w = @jinggongzhiniao_s [ 1 ]
t = @jinggongzhiniao_s [ 2 ]
s = @jinggongzhiniao_s [ 3 ]
$scene .EFS_Jinggongzhiniao ( x,y,@s_base_atk,q,w,s,@team,t)
else
# else
@jinggongzhiniao == nil
# end
return
end
player_blocked = ( target.is_a ?( EFS_Hero) and target.p_blocked ?( self ) )
critical = false
temp_animation_id = Wzj::HIT_ANIMATION_ID
return if target.dead ?
d = target.direction
shd_armor_reduce = calculate_shd_armor_reduce( d)
if rand ( 100 ) < @critical_hit
damage_reduce = 1
target.animation_id =Wzj::HIT_ANIMATION_ID_2
critical = true
else
damage_reduce = calculate_damage_reduce( d)
end
buodong = ( rand ( 10 ) -5 ) .round
#远程与近程攻击力转换
#######################
#破甲伤害计算
damage = @s_bro_atk
target.hp -= damage*damage_reduce
if target.is_a ?( EFS_Horseman)
damage = @s_base_atk +@anti_cav
else
damage = @s_base_atk +@anti_inf
end
#damage+= @charge_boun unless @rushed
#@rushed = true
shd_armor = 0
if target.guard ?
shd_armor = target.shd_hp_max * shd_armor_reduce
end
armor = shd_armor + target.armor_hp_max
damage = [ buodong+5 ,( damage-armor) *damage_reduce+buodong] .max
#如果对方溃逃加成伤害
damage = 2 *damage - damage/2 if target.move_type == 4
#如果玩家格挡住
blocked = false
if player_blocked
#damage = 2*damage
if target.use_sp ( damage)
blocked = true
else
r_damage = ( damage - target.sp ) /2
target.sp -= damage
target.hp -= r_damage
end
else
target.hp -= damage
end
if target.dead ?
target.dead unless target.already_deal_dead
display_killing_msg( target)
#获得经验
gain_exp( target.exp )
end
#闪烁动画
target.animation_id =temp_animation_id
#如果目标是玩家控制的英雄
if target.is_a ?( EFS_Hero)
if blocked
shaker( 5 ,5 ,15 )
target.add_to_popup_list ( "Guard" ,false )
else
shaker( 5 ,10 ,20 )
unless target.hero_get_hit_se ==nil
Audio.se_play ( "Audio/SE/" +target.hero_get_hit_se + ( rand ( target.hero_get_hit_se_num ) +1 ) .to_s ,100 , 100 )
end
#Audio.se_play("Audio/SE/V_Damage"+ (rand(3)+1).to_s,100, 100)
$game_screen .start_flash ( Color.new ( 255 ,0 ,0 ,100 ) , 5 )
target.add_to_popup_list ( damage.round ,critical)
target.add_to_popup_list ( "Critical" ,false ,15 ) if critical
end
end
#演奏SE
if target.guard ? and target.shd_hp > 0 and target.direction != @direction and target.def_se != nil
Audio.se_play ( "Audio/SE/" +target.def_se + ( rand ( target.def_se_num ) +1 ) .to_s ,se_v, 100 )
else
Audio.se_play ( "Audio/SE/" +@atk_se+ ( rand ( @atk_se_num) +1 ) .to_s ,se_v+20 , 100 )
end
#如果玩家挡住了
target.blocked if blocked
end
def damage_process_shoot( target) #伤害过程射击(目标)
target.show_temp_hpbar #目标。显示临时演员hp栏
target.try_dodge #目标。试着闪避
#导弹击中目标设定级别(1)
target.set_level_hit_by_missile ( 1 )
#执行特殊代码
eval ( @atk_code) if @atk_code != nil #eval(atk代码)if@atk代码!=无
# @jinggongzhiniao_s == nil
#[4,99,true]
if @jinggongzhiniao_s != nil #如果@爆炸技能!=无
#导弹击中目标设定级别(4)
target.set_level_hit_by_missile ( 4 )
x = target.x
y = target.y
q = @jinggongzhiniao_s [ 0 ]
w = @jinggongzhiniao_s [ 1 ]
t = @jinggongzhiniao_s [ 2 ]
s = @jinggongzhiniao_s [ 3 ]
$scene .EFS_Jinggongzhiniao ( x,y,@s_base_atk,q,w,s,@team,t)
else
# else
@jinggongzhiniao == nil
# end
return
end
player_blocked = ( target.is_a ?( EFS_Hero) and target.p_blocked ?( self ) )
critical = false
temp_animation_id = Wzj::HIT_ANIMATION_ID
return if target.dead ?
d = target.direction
shd_armor_reduce = calculate_shd_armor_reduce( d)
if rand ( 100 ) < @critical_hit
damage_reduce = 1
target.animation_id =Wzj::HIT_ANIMATION_ID_2
critical = true
else
damage_reduce = calculate_damage_reduce( d)
end
buodong = ( rand ( 10 ) -5 ) .round
#远程与近程攻击力转换
#######################
#破甲伤害计算
damage = @s_bro_atk
target.hp -= damage*damage_reduce
if target.is_a ?( EFS_Horseman)
damage = @s_base_atk +@anti_cav
else
damage = @s_base_atk +@anti_inf
end
#damage+= @charge_boun unless @rushed
#@rushed = true
shd_armor = 0
if target.guard ?
shd_armor = target.shd_hp_max * shd_armor_reduce
end
armor = shd_armor + target.armor_hp_max
damage = [ buodong+5 ,( damage-armor) *damage_reduce+buodong] .max
#如果对方溃逃加成伤害
damage = 2 *damage - damage/2 if target.move_type == 4
#如果玩家格挡住
blocked = false
if player_blocked
#damage = 2*damage
if target.use_sp ( damage)
blocked = true
else
r_damage = ( damage - target.sp ) /2
target.sp -= damage
target.hp -= r_damage
end
else
target.hp -= damage
end
if target.dead ?
target.dead unless target.already_deal_dead
display_killing_msg( target)
#获得经验
gain_exp( target.exp )
end
#闪烁动画
target.animation_id =temp_animation_id
#如果目标是玩家控制的英雄
if target.is_a ?( EFS_Hero)
if blocked
shaker( 5 ,5 ,15 )
target.add_to_popup_list ( "Guard" ,false )
else
shaker( 5 ,10 ,20 )
unless target.hero_get_hit_se ==nil
Audio.se_play ( "Audio/SE/" +target.hero_get_hit_se + ( rand ( target.hero_get_hit_se_num ) +1 ) .to_s ,100 , 100 )
end
#Audio.se_play("Audio/SE/V_Damage"+ (rand(3)+1).to_s,100, 100)
$game_screen .start_flash ( Color.new ( 255 ,0 ,0 ,100 ) , 5 )
target.add_to_popup_list ( damage.round ,critical)
target.add_to_popup_list ( "Critical" ,false ,15 ) if critical
end
end
#演奏SE
if target.guard ? and target.shd_hp > 0 and target.direction != @direction and target.def_se != nil
Audio.se_play ( "Audio/SE/" +target.def_se + ( rand ( target.def_se_num ) +1 ) .to_s ,se_v, 100 )
else
Audio.se_play ( "Audio/SE/" +@atk_se+ ( rand ( @atk_se_num) +1 ) .to_s ,se_v+20 , 100 )
end
#如果玩家挡住了
target.blocked if blocked
end
module Figter_data
data_id = 13
#=====基本、模型信息==========
CHARACTER_NAME[ data_id] = "夏侯渊"
HP_MAX[ data_id] = 225
AMMOR_HP[ data_id] = 20
SHD_HP[ data_id] = 0
BASE_ATK[ data_id] = 75
BRO_ATK[ data_id] = 5
S_BASE_ATK[ data_id] = 165
S_BRO_ATK[ data_id] = 80
ATK_SKILL[ data_id] = 20
DEF_SKILL[ data_id] = 5
ANTI_CAV[ data_id] = 0
ANTI_INF[ data_id] = 0
CHARGE_BOUN[ data_id] =20
MORALE[ data_id] = 65 #100max
CRITICAL_HIT[ data_id] = 0
#EXPLOSION_SETTINGS[data_id] =[20,35,true] #nil#[20,35,true,13]#nil#"e= @explosion_s.nil? ? explosion_s : @explosion_s =[20,35,true] if $game_switches[18] == true"
JINGONG_SETTINGS[ data_id] = [ 20 ,35 ,true ] #false
#(范围,动画ID,是否留垃圾
end
module Figter_data
data_id = 13
#=====基本、模型信息==========
CHARACTER_NAME[ data_id] = "夏侯渊"
HP_MAX[ data_id] = 225
AMMOR_HP[ data_id] = 20
SHD_HP[ data_id] = 0
BASE_ATK[ data_id] = 75
BRO_ATK[ data_id] = 5
S_BASE_ATK[ data_id] = 165
S_BRO_ATK[ data_id] = 80
ATK_SKILL[ data_id] = 20
DEF_SKILL[ data_id] = 5
ANTI_CAV[ data_id] = 0
ANTI_INF[ data_id] = 0
CHARGE_BOUN[ data_id] =20
MORALE[ data_id] = 65 #100max
CRITICAL_HIT[ data_id] = 0
#EXPLOSION_SETTINGS[data_id] =[20,35,true] #nil#[20,35,true,13]#nil#"e= @explosion_s.nil? ? explosion_s : @explosion_s =[20,35,true] if $game_switches[18] == true"
JINGONG_SETTINGS[ data_id] = [ 20 ,35 ,true ] #false
#(范围,动画ID,是否留垃圾
end
p keng
pkeng.png
(72.62 KB, 下载次数: 24)
作者: soulsaga 时间: 2024-9-9 19:01
你要除坑
先要知道怎么判断这个事件是坑
作者: 金芒芒 时间: 2024-9-10 10:21
# 召唤的函数
def conjure_slg(x,y,name,character_name,d)
# 生成实例
$game_map.events[$game_map.events.size+1] = Game_Event.new($game_map.map_id,produce_event_slg(x,y,name,character_name,d))
# 处理各项属性
$game_map.map.events[$game_map.events.size] = produce_event_slg(x,y,name,character_name,d)
# 重置
@spriteset.dispose
@spriteset = Spriteset_Map.new
end
# 开始生产召唤物
def produce_event_slg(x,y,name,character_name,d)
e = RPG::Event.new(x,y)
e.id = $game_map.events.size
e.name = name
e.pages = [RPG::Event::Page.new]
e.pages[0].graphic = RPG::Event::Page::Graphic.new
e.pages[0].graphic.character_name = character_name
e.pages[0].graphic.direction = d
e.pages[0].through = false
return e
end
end
作者: soulsaga 时间: 2024-9-10 10:30
看来只能从character_name着手
你的character_name是什么呢?
作者: 金芒芒 时间: 2024-9-10 13:00
本帖最后由 金芒芒 于 2024-9-10 13:08 编辑
character_name = keng
keng = conjure_temp(x,y,"trash","180-Switch03",8,1,false)
yan = conjure_temp(x,y,"trash","197-Support05",4,0,true)
false和true 因该是控制着刷新和不刷新行走图
180-Switch03.png
(2.9 KB, 下载次数: 25)
197-Support05.png
(20.36 KB, 下载次数: 29)
作者: soulsaga 时间: 2024-9-10 20:10
金芒芒 发表于 2024-9-10 13:00
character_name = keng
keng = conjure_temp(x,y,"trash","180-Switch03",8,1,false)
yan = conjure_tem ...
之后等大佬搞就行了
作者: 魔法丶小肉包 时间: 2024-9-11 16:25
1.你在Game_Event里新写一个实例变量记录一个时间,初始值为nil
2.在创建坑事件的时候给这个实例变量赋值(可以使用rand来赋予每个事件存在的时间随机化)
3.在update相关的方法里进行所有事件每n秒该实例变量-1的操作,条件是if 该实例变量
4.当该实例变量<=0的时候,把该事件erase掉然后在$game_map.events里删除该事件(只要该实例变量的值不为nil的话就一定是坑事件,所以不用特别判断哪个是坑)
作者: 金芒芒 时间: 2024-9-12 16:11
本帖最后由 金芒芒 于 2024-9-12 16:17 编辑
先研究一下我对脚本不熟悉 下面的脚本可以吗
把血迹改成垃圾keng
class Spriteset_Map
@EFS_bloods = []#血迹
def dispose
for b in @EFS_bloods
b.dispose
end
DEFAULT_BLOOD_DISAPPEAR_TIME = 300
作者: 魔法丶小肉包 时间: 2024-9-12 19:38
你这段可不可以放进去测试一下就知道了,这里详细说一下楼上我给你的思路
1.你在Game_Event里新写一个实例变量记录一个时间,初始值为nil
class Game_Event
attr_accessor :keng_time
alias mf240912initialize initialize
def initialize( map_id, event)
mf240912initialize( map_id, event)
@keng_time = nil
end
end
class Game_Event
attr_accessor :keng_time
alias mf240912initialize initialize
def initialize( map_id, event)
mf240912initialize( map_id, event)
@keng_time = nil
end
end
2.在创建坑事件的时候给这个实例变量赋值(可以使用rand来赋予每个事件存在的时间随机化)
首先要找到该方法,假设是你7楼贴出的"召唤的函数"那个,这里只是假设,如果生成坑的方法不是这个,你需要找到对应的方法然后按照例子来做
并且假设要让每个坑存在的时间随机在一定范围内的话,假设设定60~120帧
# 召唤的函数
def conjure_slg( x,y,name,character_name,d)
# 生成实例
$game_map .events [ $game_map.events .size +1 ] = Game_Event.new ( $game_map.map_id ,produce_event_slg( x,y,name,character_name,d) )
#赋予存在时间
$game_map .events [ $game_map.events .size +1 ] .keng_time = rand ( 61 ) + 60
# 处理各项属性
$game_map .map .events [ $game_map.events .size ] = produce_event_slg( x,y,name,character_name,d)
# 重置
@spriteset .dispose
@spriteset = Spriteset_Map.new
end
# 召唤的函数
def conjure_slg( x,y,name,character_name,d)
# 生成实例
$game_map .events [ $game_map.events .size +1 ] = Game_Event.new ( $game_map.map_id ,produce_event_slg( x,y,name,character_name,d) )
#赋予存在时间
$game_map .events [ $game_map.events .size +1 ] .keng_time = rand ( 61 ) + 60
# 处理各项属性
$game_map .map .events [ $game_map.events .size ] = produce_event_slg( x,y,name,character_name,d)
# 重置
@spriteset .dispose
@spriteset = Spriteset_Map.new
end
3.在update相关的方法里进行所有事件每n秒该实例变量-1的操作,条件是if 该实例变量
找到Scene_Map的update方法,在里面写入
$game_map .events .values .each do |e|
e.keng_time -= 1 if e.keng_time
end
$game_map .events .values .each do |e|
e.keng_time -= 1 if e.keng_time
end
4.当该实例变量<=0的时候,把该事件erase掉然后在$game_map.events里删除该事件
同样还是Scene_Map的update方法,刚刚的循环中继续写下去,3里刚刚那段也包括在里面了
@del_event ||= [ ]
$game_map .events .values .each do |e|
if e.keng_time
e.keng_time -= 1
if e.keng_time <= 0
e.erase
@del_event << e
end
end
end
if @del_event != [ ]
@del_event .each { |e| $game_map .events .delete ( $game_map.events .index ( e) ) }
@del_event = [ ]
end
@del_event ||= [ ]
$game_map .events .values .each do |e|
if e.keng_time
e.keng_time -= 1
if e.keng_time <= 0
e.erase
@del_event << e
end
end
end
if @del_event != [ ]
@del_event .each { |e| $game_map .events .delete ( $game_map.events .index ( e) ) }
@del_event = [ ]
end
5.附加:1~4是为你提供例子,如果照做之后发现有细节上的问题是需要做小修改才能正常运行的
作者: 金芒芒 时间: 2024-9-13 07:24
本帖最后由 金芒芒 于 2024-9-13 07:26 编辑
class Scene_Map
#--------------------------------------------------------
# ●爆炸 (中心X,中心Y,中心伤害,范围,动画ID,施放者,队伍不受(0是所有人受)是否留垃圾)
#--------------------------------------------------------
#定义 EFS爆炸(x,y,ini伤害,范围,动画id,施放者= 无,队伍 =0,垃圾=true)
def EFS_Explosion( x,y,ini_damage,range,animation_id,shifazhe = nil ,team = 0 ,trash = true )
if trash#如果垃圾
#坑= 变魔术出现临时演员 (x,y,“垃圾”,“180-开关03”,8,1,错误)
keng = conjure_temp( x,y,"trash" ,"180-Switch03" ,8 ,1 ,false )
#演 = 变魔术出现临时演员(x,y,“垃圾”,“197-支架05”,4,0,true)
yan = conjure_temp( x,y,"trash" ,"197-Support05" ,4 ,0 ,true )
end
#事件=变出临时演员(x,y,“爆炸”,“”,2)
event = conjure_temp( x,y,"EXPLOSION" ,"" ,2 )
refresh_screen#刷新屏幕
event.animation_id = animation_id#事件动画id=动画id
# $游戏屏幕。开始抖动(功率(x,y,15,1),功率(x、y,20,1)、45)
$game_screen .start_shake ( power( x,y,15 ,1 ) ,power( x,y,20 ,1 ) ,45 )
#$游戏屏幕。启动闪光灯(新颜色(255255255,功率(x,y,100,4)),10)
$game_screen .start_flash ( Color.new ( 255 ,255 ,255 ,power( x,y,100 ,4 ) ) , 10 )
#对于$游戏地图中的f。战士.价值
for f in $game_map .fighters .values
#下一个if团队!=0和f.团队==团队
next if team != 0 and f.team == team
next if f.dead ?#下一个如果f.死了?
f_juli = juli( f.x ,f.y ,x,y)
if f_juli <= range#范围
# 伤害=(范围-f_距离)*中心伤害/(范围+0.0)
damage = ( range-f_juli) *ini_damage/( range+0.0 )
#自然_伤害(f,伤害,施放者,Wzj::ONFIRE_ANIMATION)#士兵着火动画
nature_damage( f,damage,shifazhe,Wzj::ONFIRE_ANIMATION )
f.zhafei ( x,y,5 ) if damage >=25 # f.施放者(x,y,5) if 伤害 >=25
end
end
keng .animation_id = 123 #123坑。动画_id=123
end
#定义 自然伤害(目标、伤害、什法哲、动画)
def nature_damage( target,damage,shifazhe,animation)
target.hp -= damage #目标 hp-= 伤害
# p EFS_Hero
if target.dead ? #如果目标死了
target.dead #目标死了
#提示信息
display_nature_killing_msg( target,shifazhe) #跳转定义显示自然杀伤信息(目标,释放者)
end
#如果目标是玩家控制的英雄
if target.is_a ?( EFS_Hero)
#游戏场景 开始摇晃(5,10,20)
$game_screen .start_shake ( 5 ,10 ,20 )
unless target.hero_get_hit_se ==nil #除非目标。英雄被击中==无
Audio.se_play ( "Audio/SE/" +target.hero_get_hit_se + ( rand ( target.hero_get_hit_se_num ) +1 ) .to_s ,100 , 100 )
end
end
#闪烁动画
target.animation_id = animation if damage >=25 #闪烁动画=如果损坏>=25,则显示动画
end
def display_nature_killing_msg( target,shifazhe) #显示自然杀伤信息(目标,释放者)
# p shifazhe
return if target==nil
if ( shifazhe == nil )
if ( target.team == 2 ) #敌军
if target.dead ?
if target.killed ?
Notification.font .color = Wzj::T_K_E_COLOR
Notification.post ( target.the_name +"被杀了" )
Notification.font .color = Wzj::NORMAL_COLOR
else
Notification.font .color = Wzj::T_B_E_COLOR
Notification.post ( target.the_name +"被击昏了" )
Notification.font .color = Wzj::NORMAL_COLOR
end
end
else #我军
if target.dead ?
if target.killed ?
Notification.font .color = Wzj::E_K_T_COLOR
Notification.post ( target.the_name +"被杀了" )
Notification.font .color = Wzj::NORMAL_COLOR
else
Notification.font .color = Wzj::E_B_T_COLOR
Notification.post ( target.the_name +"被击昏了" )
Notification.font .color = Wzj::NORMAL_COLOR
end
end
end #if(target.team == 2)#敌军
else #if 释放者 != nil
if ( target.team == 2 ) #敌军
if target.dead ?
if target.killed ?
Notification.font .color = Wzj::T_K_E_COLOR
Notification.post ( target.the_name +"被杀了" )
Notification.font .color = Wzj::NORMAL_COLOR
else
Notification.font .color = Wzj::T_B_E_COLOR
Notification.post ( target.the_name +"被击昏了" )
Notification.font .color = Wzj::NORMAL_COLOR
end
end
else #我军
if target.dead ?
if target.killed ?
Notification.font .color = Wzj::E_K_T_COLOR
Notification.post ( target.the_name +"被杀了" )
Notification.font .color = Wzj::NORMAL_COLOR
else
Notification.font .color = Wzj::E_B_T_COLOR
Notification.post ( target.the_name +"被击昏了" )
Notification.font .color = Wzj::NORMAL_COLOR
end
end
end #if(target.team == 2)#敌军
if target.team == 2 #di军
if target.dead ?
if target.killed ?
Notification.font .color = Wzj::T_K_E_COLOR
Notification.post ( shifazhe.the_name +"击杀了" +target.the_name )
Notification.font .color = Wzj::NORMAL_COLOR
else
Notification.font .color = Wzj::T_B_E_COLOR
Notification.post ( shifazhe.the_name +"打昏了" +target.the_name )
Notification.font .color = Wzj::NORMAL_COLOR
end
end
else #wo军
if target.dead ?
if target.killed ?
Notification.font .color = Wzj::E_K_T_COLOR
Notification.post ( shifazhe.the_name +"击杀了" +target.the_name )
Notification.font .color = Wzj::NORMAL_COLOR
else
Notification.font .color = Wzj::E_B_T_COLOR
Notification.post ( shifazhe.the_name +"打昏了" +target.the_name )
Notification.font .color = Wzj::NORMAL_COLOR
end #shasile
end #死了
end #哪个军
end #释放者
end # def
def power( x,y,initial,rate) #功率(x,y,初始,速率)
unless @player_controll #除非@player控制
#方向=(x - $游戏玩家.x).绝对值 + (y - $游戏玩家.y).绝对值
d = ( x - $game_player .x ) .abs + ( y - $game_player .y ) .abs
else
#方向=(x - $现任领导人.x).绝对值 + (y - $现任领导人.y).绝对值
d = ( x - @current_leader .x ) .abs + ( y - @current_leader .leader .y ) .abs
end
v = initial - d*rate
return 0 if v <= 0
return v
end
# 生成临时物
def conjure_temp( x,y,name,character_name,d,pattern = 0 ,moving = false )
# p conjure_temp
e = Game_Event.new ( $game_map.map_id ,produce_event_temp( x,y,name,character_name,d,pattern,moving) )
# 生成实例
$game_map .events [ $game_map.events .size +1 ] = e
# 处理各项属性
$game_map .map .events [ $game_map.events .size ] = produce_event_temp( x,y,name,character_name,d,pattern,moving)
return e
end
def refresh_screen
# 重置
@spriteset .dispose
@spriteset = Spriteset_Map.new
# @spriteset.efs_refresh_character
end
#end
#=begin
# 开始生产召唤物+++++++++++++
#产生事件临时
def produce_event_temp( x,y,name,character_name,d,pattern = 0 ,moving = false )
e = RPG::Event .new ( x,y)
e.id = $game_map .events .size
# p e.id
e.name = name
# 角色扮演游戏::事件::页面。新
e.pages = [ RPG::Event::Page .new ]
# e.第[0].页图形
e.pages [ 0 ] .graphic = RPG::Event::Page::Graphic .new
e.pages [ 0 ] .graphic .character_name = character_name#图形字符名
e.pages [ 0 ] .graphic .pattern = pattern
e.pages [ 0 ] .graphic .direction = d #方向
e.pages [ 0 ] .through = true
e.pages [ 0 ] .move_frequency = 6
e.pages [ 0 ] .move_speed = 3
e.pages [ 0 ] .step_anime = moving
# p e.pages[0].graphic.character_name
# p produce_event_temp[0]
return e
end
end
class Scene_Map
#--------------------------------------------------------
# ●爆炸 (中心X,中心Y,中心伤害,范围,动画ID,施放者,队伍不受(0是所有人受)是否留垃圾)
#--------------------------------------------------------
#定义 EFS爆炸(x,y,ini伤害,范围,动画id,施放者= 无,队伍 =0,垃圾=true)
def EFS_Explosion( x,y,ini_damage,range,animation_id,shifazhe = nil ,team = 0 ,trash = true )
if trash#如果垃圾
#坑= 变魔术出现临时演员 (x,y,“垃圾”,“180-开关03”,8,1,错误)
keng = conjure_temp( x,y,"trash" ,"180-Switch03" ,8 ,1 ,false )
#演 = 变魔术出现临时演员(x,y,“垃圾”,“197-支架05”,4,0,true)
yan = conjure_temp( x,y,"trash" ,"197-Support05" ,4 ,0 ,true )
end
#事件=变出临时演员(x,y,“爆炸”,“”,2)
event = conjure_temp( x,y,"EXPLOSION" ,"" ,2 )
refresh_screen#刷新屏幕
event.animation_id = animation_id#事件动画id=动画id
# $游戏屏幕。开始抖动(功率(x,y,15,1),功率(x、y,20,1)、45)
$game_screen .start_shake ( power( x,y,15 ,1 ) ,power( x,y,20 ,1 ) ,45 )
#$游戏屏幕。启动闪光灯(新颜色(255255255,功率(x,y,100,4)),10)
$game_screen .start_flash ( Color.new ( 255 ,255 ,255 ,power( x,y,100 ,4 ) ) , 10 )
#对于$游戏地图中的f。战士.价值
for f in $game_map .fighters .values
#下一个if团队!=0和f.团队==团队
next if team != 0 and f.team == team
next if f.dead ?#下一个如果f.死了?
f_juli = juli( f.x ,f.y ,x,y)
if f_juli <= range#范围
# 伤害=(范围-f_距离)*中心伤害/(范围+0.0)
damage = ( range-f_juli) *ini_damage/( range+0.0 )
#自然_伤害(f,伤害,施放者,Wzj::ONFIRE_ANIMATION)#士兵着火动画
nature_damage( f,damage,shifazhe,Wzj::ONFIRE_ANIMATION )
f.zhafei ( x,y,5 ) if damage >=25 # f.施放者(x,y,5) if 伤害 >=25
end
end
keng .animation_id = 123 #123坑。动画_id=123
end
#定义 自然伤害(目标、伤害、什法哲、动画)
def nature_damage( target,damage,shifazhe,animation)
target.hp -= damage #目标 hp-= 伤害
# p EFS_Hero
if target.dead ? #如果目标死了
target.dead #目标死了
#提示信息
display_nature_killing_msg( target,shifazhe) #跳转定义显示自然杀伤信息(目标,释放者)
end
#如果目标是玩家控制的英雄
if target.is_a ?( EFS_Hero)
#游戏场景 开始摇晃(5,10,20)
$game_screen .start_shake ( 5 ,10 ,20 )
unless target.hero_get_hit_se ==nil #除非目标。英雄被击中==无
Audio.se_play ( "Audio/SE/" +target.hero_get_hit_se + ( rand ( target.hero_get_hit_se_num ) +1 ) .to_s ,100 , 100 )
end
end
#闪烁动画
target.animation_id = animation if damage >=25 #闪烁动画=如果损坏>=25,则显示动画
end
def display_nature_killing_msg( target,shifazhe) #显示自然杀伤信息(目标,释放者)
# p shifazhe
return if target==nil
if ( shifazhe == nil )
if ( target.team == 2 ) #敌军
if target.dead ?
if target.killed ?
Notification.font .color = Wzj::T_K_E_COLOR
Notification.post ( target.the_name +"被杀了" )
Notification.font .color = Wzj::NORMAL_COLOR
else
Notification.font .color = Wzj::T_B_E_COLOR
Notification.post ( target.the_name +"被击昏了" )
Notification.font .color = Wzj::NORMAL_COLOR
end
end
else #我军
if target.dead ?
if target.killed ?
Notification.font .color = Wzj::E_K_T_COLOR
Notification.post ( target.the_name +"被杀了" )
Notification.font .color = Wzj::NORMAL_COLOR
else
Notification.font .color = Wzj::E_B_T_COLOR
Notification.post ( target.the_name +"被击昏了" )
Notification.font .color = Wzj::NORMAL_COLOR
end
end
end #if(target.team == 2)#敌军
else #if 释放者 != nil
if ( target.team == 2 ) #敌军
if target.dead ?
if target.killed ?
Notification.font .color = Wzj::T_K_E_COLOR
Notification.post ( target.the_name +"被杀了" )
Notification.font .color = Wzj::NORMAL_COLOR
else
Notification.font .color = Wzj::T_B_E_COLOR
Notification.post ( target.the_name +"被击昏了" )
Notification.font .color = Wzj::NORMAL_COLOR
end
end
else #我军
if target.dead ?
if target.killed ?
Notification.font .color = Wzj::E_K_T_COLOR
Notification.post ( target.the_name +"被杀了" )
Notification.font .color = Wzj::NORMAL_COLOR
else
Notification.font .color = Wzj::E_B_T_COLOR
Notification.post ( target.the_name +"被击昏了" )
Notification.font .color = Wzj::NORMAL_COLOR
end
end
end #if(target.team == 2)#敌军
if target.team == 2 #di军
if target.dead ?
if target.killed ?
Notification.font .color = Wzj::T_K_E_COLOR
Notification.post ( shifazhe.the_name +"击杀了" +target.the_name )
Notification.font .color = Wzj::NORMAL_COLOR
else
Notification.font .color = Wzj::T_B_E_COLOR
Notification.post ( shifazhe.the_name +"打昏了" +target.the_name )
Notification.font .color = Wzj::NORMAL_COLOR
end
end
else #wo军
if target.dead ?
if target.killed ?
Notification.font .color = Wzj::E_K_T_COLOR
Notification.post ( shifazhe.the_name +"击杀了" +target.the_name )
Notification.font .color = Wzj::NORMAL_COLOR
else
Notification.font .color = Wzj::E_B_T_COLOR
Notification.post ( shifazhe.the_name +"打昏了" +target.the_name )
Notification.font .color = Wzj::NORMAL_COLOR
end #shasile
end #死了
end #哪个军
end #释放者
end # def
def power( x,y,initial,rate) #功率(x,y,初始,速率)
unless @player_controll #除非@player控制
#方向=(x - $游戏玩家.x).绝对值 + (y - $游戏玩家.y).绝对值
d = ( x - $game_player .x ) .abs + ( y - $game_player .y ) .abs
else
#方向=(x - $现任领导人.x).绝对值 + (y - $现任领导人.y).绝对值
d = ( x - @current_leader .x ) .abs + ( y - @current_leader .leader .y ) .abs
end
v = initial - d*rate
return 0 if v <= 0
return v
end
# 生成临时物
def conjure_temp( x,y,name,character_name,d,pattern = 0 ,moving = false )
# p conjure_temp
e = Game_Event.new ( $game_map.map_id ,produce_event_temp( x,y,name,character_name,d,pattern,moving) )
# 生成实例
$game_map .events [ $game_map.events .size +1 ] = e
# 处理各项属性
$game_map .map .events [ $game_map.events .size ] = produce_event_temp( x,y,name,character_name,d,pattern,moving)
return e
end
def refresh_screen
# 重置
@spriteset .dispose
@spriteset = Spriteset_Map.new
# @spriteset.efs_refresh_character
end
#end
#=begin
# 开始生产召唤物+++++++++++++
#产生事件临时
def produce_event_temp( x,y,name,character_name,d,pattern = 0 ,moving = false )
e = RPG::Event .new ( x,y)
e.id = $game_map .events .size
# p e.id
e.name = name
# 角色扮演游戏::事件::页面。新
e.pages = [ RPG::Event::Page .new ]
# e.第[0].页图形
e.pages [ 0 ] .graphic = RPG::Event::Page::Graphic .new
e.pages [ 0 ] .graphic .character_name = character_name#图形字符名
e.pages [ 0 ] .graphic .pattern = pattern
e.pages [ 0 ] .graphic .direction = d #方向
e.pages [ 0 ] .through = true
e.pages [ 0 ] .move_frequency = 6
e.pages [ 0 ] .move_speed = 3
e.pages [ 0 ] .step_anime = moving
# p e.pages[0].graphic.character_name
# p produce_event_temp[0]
return e
end
end
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1