public override bool OnEvent(IEvent e) { if (e.GetType() == typeof(PlayerUnitSummonEvent)) { PlayerUnitSummonEvent summonEvent = e as PlayerUnitSummonEvent; for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { if (i == 0 && j == 0) { continue; } if (summonEvent.SummonTilePos == Target.UnitPosition + new Vector3(i, 0, j)) { GameManager.Instance.EffectSystem.CreateEffect("BeamUpRed", Target.UnitPosition + new Vector3(0, 0.2f, -0.2f), new Vector3(0.3f, 0.3f, 0.3f), Quaternion.Euler(new Vector3(-90, 0, 0)), 1); Target.AddAdditionalDamage(10); return(true); } } } } return(false); }
public override bool OnEvent(IEvent e) { if (e.GetType() == typeof(DamageEvent)) { DamageEvent damageEvent = e as DamageEvent; PlayerUnit playertarget = Target as PlayerUnit; if (damageEvent.Publisher == playertarget) { GameManager.Instance.EffectSystem.CreateEffect("BeamUpRed", Target.UnitPosition + new Vector3(0, 0.2f, -0.2f), new Vector3(0.3f, 0.3f, 0.3f), Quaternion.Euler(new Vector3(-90, 0, 0)), 1); Target.AddAdditionalDamage(2); } } return(true); }
public override bool OnEvent(IEvent e) { if (e.GetType() == typeof(TileEnterEvent)) { TileEnterEvent tileEnter = e as TileEnterEvent; PlayerUnit playertarget = Target as PlayerUnit; if (TileManager.Instance.GetContainPlayerUnit(tileEnter.EnterTilePos.x, tileEnter.EnterTilePos.z) == playertarget) { GameManager.Instance.EffectSystem.CreateEffect("BeamUpRed", Target.UnitPosition + new Vector3(0, 0.2f, -0.2f), new Vector3(0.3f, 0.3f, 0.3f), Quaternion.Euler(new Vector3(-90, 0, 0)), 1); Target.AddAdditionalDamage(10); } } return(true); }