public override bool Update(float dt) { if (Movement.Update(dt)) { //普攻伤害 if (damage > 0) { if (isAttack) { Target.removeExpectedDamage(damage); } Target.LostHP(damage, Shooter, damageType, isAttack); } //给目标上buff if (buffs != null) { for (int i = 0; i < buffs.Length; ++i) { Target.AddBuff(buffs[i], Shooter); } } //AOE if (aoeRadius > 0) { AoeRegion region = new CircleRegion(BattleInterface.Instance.world, position.x, position.y, aoeRadius); AoeField aoe = new AoeField(Shooter, region, duration, interval, emitters); BattleInterface.Instance.AddAoeField(aoe); } return(true); } return(false); }
static int removeExpectedDamage(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); BattleSystem.ObjectModule.UnitBase obj = (BattleSystem.ObjectModule.UnitBase)ToLua.CheckObject <BattleSystem.ObjectModule.UnitBase>(L, 1); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); obj.removeExpectedDamage(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }