然后建立demoness.lua文件(怎么建立自己去看论坛帖子)。
function calccells_all_enemy_absorption()
-- local acnt = Attack.act_count()
-- for i=1,acnt-1 do
for c=0,Attack.cell_count()-1 do
local i = Attack.cell_get(c)
if (Attack.act_enemy(i)) and Attack.act_hp(i)>0 then -- contains enemy
if Attack.act_applicable(i) and Attack.act_hp(i)>0 then -- can receive this attack
Attack.marktarget(i) -- select it
end
end
end
return true
end
function special_godabsorption()
local target = Attack.get_target()
Attack.aseq_rotate(0, target)
Attack.act_aseq( 0, "castmagic" )<-----------------------------------------这个是动作而已
local dmgts = Attack.aseq_time(0, "x")
local hp = Attack.act_hp(target)<---------------------------------------------原来食人魔的技能描述都是AP,我改成了HP而已,哈哈!
if hp > 0 then
Attack.act_hp(target, 1) -- 镳铖蝾 潆 铗钺疣驽龛 0 文
Attack.atom_spawn(target, 0, "effect_absorption")
--if not (Attack.act_skipmove(target) > 0) then -- 羼腓 栩 箧?镳铒篑赅弪 躅?(铗 铖脲镫屙?), 蝾 翦牝 礤 耋祆桊箦?
--Attack.act_skipmove(target, 1)<-----------------------------------------------这里食人魔的技能本来是0,意思吸收AP到0点,我改成吸收HP到1点,因为HP变成0,敌人部队不会死的,反而变成无法攻击的状态!而变成1点就碰一下就死了。
Attack.act_attach_modificator(target, "skipmove" , "skipmove_absorption", 1, 0, 0, 1)
--end
Attack.act_hp(0, Attack.act_hp(0)+hp)<---------------------------------------吸收了敌人的HP后会加到当前部队的HP上,如果原来是魅魔是10点,敌人部队是20点生命,技能使用后会吸收19点HP,那么就会在当前魅魔的生命上增加19HP,变成10+19=29。
end
return true
end
-- ***********************************************
-- * Angel-Avenger
-- ***********************************************
function spell_angel_avenger_attack()
local level=Obj.spell_level()<-----------------------------------------------这里你改成3的话,就是3级的复仇天使了
if level==0 then level=1 end
local target = Attack.get_target()
Attack.act_del_spell(target,"spell_angel_avenger")
local duration = tonumber("0" .. text_dec(Logic.obj_par("spell_angel_avenger","duration"),level))
if Logic.obj_par("spell_angel_avenger","int")=="1" then
duration = duration + math.floor(HInt()/tonumber(Game.Config("spell_power_config/int_duration")))
end
Attack.act_apply_spell_begin( target, "spell_angel_avenger", duration, false )
Attack.act_posthitslave(target, "post_spell_angel_avenger", duration)
local min_dmg, max_dmg = pwr_angel_avenger(level)
Attack.act_spell_param(target, "spell_angel_avenger", "damage", min_dmg.."-"..max_dmg)
Attack.act_apply_spell_end()
Attack.atom_spawn(target, 0, "magic_avenger",Attack.angleto(target))
return true
end
function find_unit_by_uid(uid)
for i=1, Attack.act_count()-1 do
if Attack.act_uid(i) == uid then return i end
end
end
function post_spell_angel_avenger(damage,addrage,attacker,receiver,minmax,userdata)
local spell = "spell_angel_avenger"
if Attack.act_is_spell(receiver,spell) then
if minmax == 0 then
if Attack.get_caa(attacker) ~= nil and not Attack.act_ally(attacker, Attack.act_belligerent(receiver)) then -- 羼腓 ?礤 耧咫?- 铗忮鬣屐, 怛铕? 镳钼屦赅 - 黩钺?礤 铗忮鬣螯 疋铊?
local dmg_type = Logic.obj_par(spell,"typedmg")
local a = Attack.atom_spawn(attacker, 0, "angel_avenger")
Attack.val_store(a, "damage", Game.CurLocRand(text_range_dec(Attack.act_spell_param(receiver, spell, "damage"))))
Attack.val_store(a, "dmg_type", dmg_type)
Attack.val_store(a, "belligerent", Attack.act_belligerent(receiver)) -- 潆 镳噔桦钽?鲡弪??腩沐
Attack.val_store(a, "receiver_uid", Attack.act_uid(receiver))
Attack.val_store(a, "target_uid", Attack.act_uid(attacker))
Attack.val_store(a, "creator", "magic") -- 潆 耱囹桉蜩觇 镱耠?犷
Attack.resort(Attack.get_caa(a))
end
-- Attack.act_posthitslave(receiver,"post_spell_angel_avenger",0)
end
else
Attack.act_posthitslave(receiver,"post_spell_angel_avenger",0)
end
return damage
end
function angel_avenger_attack()
Attack.log_label('null')
local act = find_unit_by_uid(Attack.val_restore("target_uid"))-- Attack.get_caa(Attack.get_cell(0))
if act ~= nil then
local a = Attack.atom_spawn(act, 0, "magic_lightning")
Attack.atk_set_damage(Attack.val_restore("dmg_type"), Attack.val_restore("damage"))
common_cell_apply_damage(act, Attack.aseq_time(a, "x"))
Attack.log_label('')
local receiver = find_unit_by_uid(Attack.val_restore("receiver_uid"))
if receiver ~= nil then
local spell = "spell_angel_avenger"
local dur = Attack.act_spell_duration(receiver, spell)
if dur <= 1 then
Attack.act_posthitslave(receiver,"post_spell_angel_avenger",0)
Attack.act_del_spell( receiver, spell )
else
Attack.act_spell_duration(receiver, spell, dur-1)
end
end
end
Attack.act_remove(0, 0)
return true
end