public override bool OnGiveDamage(UnitModel actor, UnitModel target, ref DamageInfo dmg) { // Should make the weapon do no damage dmg = DamageInfo.zero; // Activate buff to absorb BLACK damage if (actor.HasUnitBuf(UnitBufType.BARRIER_B)) { if (actor.GetUnitBufByName(typeof(HellTrainBuff).Name) == null) { actor.RemoveUnitBuf(actor.GetUnitBufByType(UnitBufType.BARRIER_B)); actor.AddUnitBuf(new HellTrainBuff()); } } else { actor.AddUnitBuf(new HellTrainBuff()); } return(base.OnGiveDamage(actor, target, ref dmg)); }
// static UnitBufType customType = (UnitBufType)Enum.GetValues(typeof(UnitBufType)).Cast<int>().Max() + 123; public override bool OnGiveDamage(UnitModel actor, UnitModel target, ref DamageInfo dmg) { HellTrainDebuff debuff = new HellTrainDebuff(); if (!target.HasUnitBuf(debuff.type)) { target.AddUnitBuf(debuff); } else { (target.GetUnitBufByType(debuff.type) as HellTrainDebuff).RemainTime = rTime; } return(base.OnGiveDamage(actor, target, ref dmg)); }
public override bool OnGiveDamage(UnitModel actor, UnitModel target, ref DamageInfo dmg) { Harmony.FileLog.Log("OnGiveDamage Train"); target.AddUnitBuf(new HellTrainDebuff()); return(base.OnGiveDamage(actor, target, ref dmg)); }