Ejemplo n.º 1
0
 public CombatEventArgs(UnitEventType eventType, Unit attacker, Unit defender, List <bool> combatRoundsAttackerWins,
                        List <int> attackerHitpoints, List <int> defenderHitpoints) : base(eventType, new [] { attacker.CurrentLocation, defender.CurrentLocation })
 {
     Attacker = new UnitInfo(attacker, attackerHitpoints);
     Defender = new UnitInfo(defender, defenderHitpoints);
     CombatRoundsAttackerWins = combatRoundsAttackerWins;
     Sound = attacker.AttackSound;
 }
 public UnitEventArgs(UnitEventType eventType, IUnit attacker, IUnit defender, List <bool> combatRoundsAttackerWins, List <int> attackerHitpoints, List <int> defenderHitpoints)
 {
     EventType = eventType;
     Attacker  = attacker;
     Defender  = defender;
     CombatRoundsAttackerWins = combatRoundsAttackerWins;
     AttackerHitpoints        = attackerHitpoints;
     DefenderHitpoints        = defenderHitpoints;
 }
Ejemplo n.º 3
0
 public virtual void receiveEvent(UnitsTag otherTag, UnitEventType eventType, Status otherStatus, GameObject _target = null)
 {
     switch (eventType)
     {
     case UnitEventType.Hit:
         if (otherTag == UnitsTag.Champion &&
             unitTag == UnitsTag.Minion &&
             _target)
         {
         }
         break;
     }
 }
Ejemplo n.º 4
0
 public override void OnCreated()
 {
     CurrentHealthPoint = MaximumHealthPoint;
     State         = UnitState.Lives;
     DecayTimeLeft = DecayTime;
     Tension       = 0;
     CrowdControlGroup.Clear();
     MaterialApplier.RevertTrigger();
     Controller.enabled = true;
     Invincible         = false;
     Pause = false;
     RevertLoopOptionOfAttachedParticleSet(true);
     CastSpeedMultiplier     = 1.0f;
     MovementSpeedMultiplier = 1.0f;
     NextEvent = UnitEventType.None;
 }
Ejemplo n.º 5
0
        public virtual void GiveEvent(UnitEventType eventType)
        {
            RaycastHit[] hits = Physics.SphereCastAll(transform.position, UnitSight.sightRange, Vector3.up, 0f);

            foreach (RaycastHit hit in hits)
            {
                if (this == hit.transform.gameObject)
                {
                    continue;
                }
                if (hit.transform.CompareTag("particle"))
                {
                    continue;
                }

                if (hit.transform.CompareTag(transform.tag))
                {
                    Units script;

                    if (hit.transform.TryGetComponent <Units>(out script))
                    {
                        switch (eventType)
                        {
                        case UnitEventType.Death:
                            script.receiveEvent(unitTag, eventType, UnitStatus);
                            break;

                        case UnitEventType.Hit:
                            script.receiveEvent(unitTag, eventType, UnitStatus, Target);
                            break;

                        default:
                            break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 6
0
 protected UnitEventArgs(UnitEventType eventType, IList <Tile> locations)
 {
     Location  = locations;
     EventType = eventType;
 }
Ejemplo n.º 7
0
 public void SetNextEvent(UnitEventType toTransition)
 {
     NextEvent = UnitEventType.None;
 }
 public UnitEventArgs(UnitEventType eventType)
 {
     EventType = eventType;
 }
Ejemplo n.º 9
0
 public MovementBlockedEventArgs(UnitEventType eventType, Unit subjectUnit, BlockedReason reason) : base(eventType, new [] { subjectUnit.CurrentLocation })
 {
     Reason = reason;
 }
Ejemplo n.º 10
0
 public static void TriggerEvent(UnitEventType type, Unit unit)
 {
     m_unitEvents[type].Raise(unit);
 }