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; }
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; } }
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; }
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; } } } } }
protected UnitEventArgs(UnitEventType eventType, IList <Tile> locations) { Location = locations; EventType = eventType; }
public void SetNextEvent(UnitEventType toTransition) { NextEvent = UnitEventType.None; }
public UnitEventArgs(UnitEventType eventType) { EventType = eventType; }
public MovementBlockedEventArgs(UnitEventType eventType, Unit subjectUnit, BlockedReason reason) : base(eventType, new [] { subjectUnit.CurrentLocation }) { Reason = reason; }
public static void TriggerEvent(UnitEventType type, Unit unit) { m_unitEvents[type].Raise(unit); }