public static void RemoveCrewMember(Entities.Ship Ship, Entities.Neko Neko) { if (Ship.Crew.Contains(Neko)) { Ship.FirePower -= Neko.FirePower; Ship.MaxHP -= Neko.HP; Ship.Crew.Remove(Neko); } }
void OnBulletListVsShipListCollisionOccurred(Entities.Bullet bullet, Entities.Ship ship) { if (bullet.TeamIndex != ship.TeamIndex) { var effect = ShipImpactFactory.CreateNew(); effect.EmitEffectParticles(bullet.Position.ToVector2(), -bullet.Velocity.Normalized().ToVector2()); bullet.CollideAgainstBounce(ship, .05f, 1, 1); bullet.Destroy(); ship.TakeDamage(Bullet.DamageToDeal, bullet.Owner); } }
public static void CalculateStats(Entities.Ship Ship) { int hp = 0; int fp = hp; foreach (Entities.Neko n in Ship.Crew) { hp += n.HP; fp += n.FirePower; } Ship.FirePower += fp; // if (Ship.FirePower < 0) { Ship.FirePower = 0; } Ship.MaxHP += hp; // if (Ship.MaxHP < 0) { Ship.MaxHP = 1; } Ship.CurrentHP = Ship.MaxHP; }
void OnShipListVsShipListCollisionOccurred(Entities.Ship first, Entities.Ship second) { if (first.TeamIndex == second.TeamIndex) { return; } if (first.CanRamShip(second)) { DoTheRamming(first, second); } else if (second.CanRamShip(first)) { DoTheRamming(second, first); } else { TrySteerShipAwayFromCollision(first, second); TrySteerShipAwayFromCollision(second, first); first.CollideAgainstBounce(second, 1, 1, .3f); } }
void OnAfterDying(Entities.Ship value) { ShipDeathEffectFactory.CreateNew().TriggerEffect(X, Y, RotationZ); shipdeath01.Play(); }