赞 | 3 |
VIP | 12 |
好人卡 | 0 |
积分 | 3 |
经验 | 9192 |
最后登录 | 2023-6-10 |
在线时间 | 312 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 262
- 在线时间
- 312 小时
- 注册时间
- 2010-8-2
- 帖子
- 355
|
#这是例子,技能的。
class Temp_Earth_Sky < ARPG_Obj
#--------------------------------------------------------------------------
# ● 初始化
# supet 所属。
# val 扩展功能变量。
#--------------------------------------------------------------------------
def initialize(supet=nil,ream = nil)
super
@direction = @supet.direction #初始方向和主角相同
@left = 11 #生命 生命一定要大于延迟,否则等不到攻击
@attack_num = 1 #伤害次数
@attack_per = 100 #攻击效果周期,两次攻击之间的间隔(周期小了频率大了机子受不了)
@attack_del = 1 #延迟使用技能条件达成后多久产生伤害
@resort = 60 #滞留的时间
set_target#设置攻击对象范围
$game_map.push_obj(self)
@x,@y,@c=ream
set_xy #设置位置
$game_map.push_obj(self)
end
def set_xy
@real_x = @x*256
@real_y = @y*256
for i in -@c..@c
for j in -@c..@c
$game_map.ani_play(58,@real_x+i*256,real_y+j*256) if rand(100)<20
end
end
end
#--------------------------------------------------------------------------
# ●设置攻击范围
# 可能返回值不同 若为2个数则为点,4个数为范围
# 多数组为复合范围
#--------------------------------------------------------------------------
def scope
return [@x-@c,@y-@c,@x+@c,@y+@c]
end
#--------------------------------------------------------------------------
# ●设置攻击对象
#--------------------------------------------------------------------------
def set_target
case @supet
when Game_Player #角色
@target_kinds.push(2) #设置添加敌人类别
when Game_Event
@target_kinds.push(1)
end
end
#--------------------------------------------------------------------------
# ●攻击对象
# 攻击效果前执行
#--------------------------------------------------------------------------
def attack(target)
if target.change_action"这里填被攻击啦会怎么样?不是这样填,我这是解说")
target.add("这里填被攻击啦会怎么样",20,@supet)
end
target.hp_damage = make_attack_damage_value(@supet,target)*50/10
# target.animation_id = 2
end
end
|
|