【教程】利用Helper做毒
资料引用于://tieba.baidu.com/p/1506027213
首先,要理解毒的原理——永续target,既取得目标后,利用常时reversaldef使其一直维持下去。
第一步就是先要取得对方的目标,分成三种手段,hitdef、projectile以及reversaldef,因为proj默认归属于本体,所以即使 helper的放出的proj击中了目标,取得target的也只是本体的,所以排不上用场。。。在这里我先拿一个简单的hitdef的版本给大家演示一下
基本构思是给kfm加一个用helper做成的飞行道具,击中对方后使其中毒
先给飞行道具来个图,我的选择是,这个看个人喜好的,没图也无所谓
用FFU打开人物,导入已经处理成256色且底色透明的飞行道具的图片,详略
然后再添加动画,随便给个没有被占用的动画编号,详略
如果你允许被击落的话,可以加上蓝框配合destroyself,详略
另外红框越大,攻击范围越大,你懂的
然再添加一组动画,不需要画任何攻击或者受击框
到这sff和air的准备就完成了,然后开始写代码
我这边为了方便,直接选择在在kfm的轻拳状态(statedef 200)发射helper
[Statedef 200]
type = S ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A ;Move-type: A-attack, I-idle, H-gethit
physics = S ;Physics: S-stand, C-crouch, A-air
juggle = 1 ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0 ;Set velocity (x,y) (Def: no change)
ctrl = 0 ;Set ctrl (Def: no change)
anim = 200 ;Change animation (Def: no change)
poweradd = 20 ;Power to add (Def: 0)
sprpriority = 2 ;Set p1's sprite layering priority to 2 (in front)
[State ]
type = Helper;召唤援护
triggerall = !numhelper(12345);不存在helper(12345)时召唤,确保只召唤一个
trigger1 = AnimElem = 3;轻拳使用的动画的第三张图时发射
helpertype = player;helper类型,我选palyer型是因为-2下的代码对其他类型不起作用
ID = 12345;ID配合上面的!numhelper(12345)以及待会在statedef-2下的selfstate
name = "paopao"; helper的名字,起不起无所谓
postype = p1;位置类型
pos = 44,-67;出现位置,改变数字移动坐标,详略
stateno = 12345;helper被召唤出来时的初始状态
ownpal = 1;不会受本体的PalFX影响而变色
ignorehitpause = 1
supermovetime = 999999
pausemovetime = 999999
然后是helper的状态,这边只讲比较重要的一些
[statedef 12345]
Type = A
moveType= A
physics = N
juggle = 8
poweradd= 0
velset = ifelse(NumTarget=0,3,0),0;未获得目标之前保持朝着面对方向3的速度,获得则为0
ctrl = 0
sprpriority = 3
[State ];允许离开屏幕
Type = ScreenBound
Trigger1 = IsHelper
Value = 0
movecamera = 0
IgnoreHitPause = 1
[State ];不会对玩家造成推挤
Type = PlayerPush
Trigger1 = IsHelper
Value = 0
IgnoreHitPause = 1
[State ];未获得目标之前保持带有红框的动画
Type = ChangeAnim
Trigger1 = NumTarget= 0
Value = 12345
IgnoreHitPause = 1
[State ];未获得目标之前保持攻击活动状态(A=攻击、H=受击、I=啥都没干)
type = StateTypeSet
trigger1 = NumTarget = 0
trigger2 = NumTarget > 0
trigger2 = Target,IsHelper
trigger3 = Anim = 12345
movetype = A
[State ];hitdef用来击中对方取得目标
Type = Hitdef
Trigger1 = NumTarget = 0;没有目标时发动
trigger1 = !Target,IsHelper;确保目标不是helper而是敌人本体
damage = 20,5
getpower = 0,0
givepower = 0,0
pausetime = 0,9
attr = S,SP
guardflag = MA
animType = heavy
air.animType = back
priority = 5, hit
sparkno = -1;火花,我这边图方便没写
guard.sparkno = 40
sparkxy = 0, 0
hitsound = -1
guardsound = -1
ground.Type = low
air.Type = high
air.hittime = 8
ground.slidetime = 13
ground.hittime = 17
ground.velocity = -7, 0
air.velocity = -3, -7
fall.recover = 0
air.fall = 1
yaccel = .5
envshake.time = 16
envshake.freq = 60
envshake.ampl = 4
numhits = 0
[State ];放下目标
Type = TargetDrop
Trigger1 = NumTarget > 0
Trigger1 = Target,IsHelper || !Target,Alive ;目标为helper或者目标已死亡
IgnoreHitPause = 1
[State ];获得目标后改变动画,获得目标后切换到无判定框的动画
Type = ChangeAnim
Trigger1 = NumTarget != 0
Value = 54321
IgnoreHitPause = 1
[State ];获得目标后改变为非攻击且非受击活动状态
type = StateTypeSet
trigger1 = NumTarget > 0
trigger1 = !Target,IsHelper
trigger2 = Anim = 54321
movetype = I
[State ];获得目标绑定到本体,以便于监视
type = BindToRoot
trigger1 = NumTarget > 0
trigger1 = !Target,IsHelper;确认目标不是helper
IgNoreHitPause = 1
击中目标后绑回到本体↑
[State ];获得目标后常时当身,从而维持永续
Type = ReversalDef
Trigger1 = NumTarget > 0;目标大于0时发动
trigger1 = !Target,IsHelper;确保获得的目标不是helper
Reversal.Attr = SCA,AA,AP,AT
PauseTime = 0,0
SparkNo = -1
HitSound = -1
numhits = 0
IgnoreHitPause = 1
[State ];目标生命减少,毒的效果体现
type = TargetLifeAdd
triggerall = RoundState = 2
triggerall = !Target,IsHelper
triggerall = NumTarget != 0
trigger1 = Gametime%12 = 0 ;每隔12帧执行一次,1帧为60分之1秒,直接写1就是每帧执行,数字越大,发动间隔越大
value = -5;每次减少的生命量,无节操的话写个-99999999之类的
kill = 0;确保不会毒死人
IgnoreHitPause = 1
[State ];helper自灭,自灭之后毒自动解除
type = DestroySelf
trigger1 = !Ishelper(12345);如果id不为12345直接自灭
trigger2 = time > 360;6秒后自灭
IgnoreHitPause = 1
最后在[statedef -2]下面加上一段
[state ]
type = selfstate
trigger1 = IsHelper(12345)
trigger1 = stateno != 12345
value = 12345
ignorehitpause = 1
以上就是简单的毒的制作,如果想要应用于凶恶的话
可以写在-3下常时召唤,将红框改成最大,最初的目标也用常时reversaldef来获取,不写destroyself,配合targetstate导入超即死状态、roundstateno > 2时发动普通死宣等等
好