Example #1
0
        public override void Attach(LogicUnit g, LogicUnit t)
        {
            base.Attach(g, t);

            if (t.type == LogicUnitType.Soldier)
            {
                soldier = (Soldier)t;

                if (ownerDebuff.sneerEffect == null && soldier != null && soldier.Alive())
                {
                    if (!soldier.GetFlag(SoldierAttributeFlags.BanSkill))
                    {
                        soldier.SetFlag(SoldierAttributeFlags.BanSkill);
                    }
                    soldier.skillHandler.SetHandlerEnabled(false);

                    if (!soldier.GetFlag(SoldierAttributeFlags.BanCommand))
                    {
                        soldier.SetFlag(SoldierAttributeFlags.BanCommand);
                    }

                    ownerDebuff.sneerEffect = this;
                    soldier.ClearPathRender();
                    soldier.Chase(g);
                }
            }
            else
            {
                DebugUtils.LogError(DebugUtils.Type.AI_AttributeEffect, string.Format("{0} {1} can't handle debuff now!", t.type, t.id));
            }
        }
Example #2
0
        public override void Attach(LogicUnit g, LogicUnit t)
        {
            base.Attach(g, t);

            // TODO: wait to add a trigger in soldier

            if (t.type == LogicUnitType.Soldier)
            {
                soldier = (Soldier)t;

                if (!soldier.GetFlag(SoldierAttributeFlags.BanSkill))
                {
                    soldier.SetFlag(SoldierAttributeFlags.BanSkill);
                }
                soldier.skillHandler.SetHandlerEnabled(false);
            }
            else
            {
                DebugUtils.LogError(DebugUtils.Type.AI_AttributeEffect, string.Format("{0} {1} can't handle {2} {3} now!", t.type, t.id, type, attributeAffectType));
            }
        }