Ejemplo n.º 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));
            }
        }
Ejemplo n.º 2
0
        public override void Detach()
        {
            base.Detach();

            if (soldier.GetFlag(SoldierAttributeFlags.BanSkill))
            {
                soldier.RemoveFlag(SoldierAttributeFlags.BanSkill);
            }
            soldier.skillHandler.SetHandlerEnabled(true);
        }
Ejemplo n.º 3
0
        public override void Detach()
        {
            base.Detach();

            DebugUtils.Log(DebugUtils.Type.AI_AttributeEffect, string.Format(" {0} {1} has been detached", type, attributeAffectType));

            if (soldier.GetFlag(SoldierAttributeFlags.BanSkill))
            {
                soldier.RemoveFlag(SoldierAttributeFlags.BanSkill);
            }
            soldier.skillHandler.SetHandlerEnabled(true);

            if (soldier.GetFlag(SoldierAttributeFlags.BanCommand))
            {
                soldier.RemoveFlag(SoldierAttributeFlags.BanCommand);
            }

            soldier.target = null;
            soldier.ChangeState(1, soldier.fsmIdle);
            ownerDebuff.sneerEffect = null;
        }
Ejemplo n.º 4
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));
            }
        }