public override void OnThink() { base.OnThink(); if (DateTime.UtcNow > m_NextShipChewAllowed && ShipOccupied != null) { if (ShipOccupied.Deleted || ShipOccupied.m_SinkTimer != null) { return; } Say("*chews on the ship*"); SpecialAbilities.HinderSpecialAbility(1.0, this, this, 1.0, 3, true, 0, false, "", "", "-1"); m_NextShipChewAllowed = DateTime.UtcNow + NextShipChewDelay; Point3D location = Location; Map map = Map; for (int a = 0; a < 3; a++) { Timer.DelayCall(TimeSpan.FromSeconds(a * 1), delegate { if (this == null) { return; } if (Deleted || !Alive) { return; } LastCombatTime = LastCombatTime + TimeSpan.FromSeconds(1); ShipOccupied.ReceiveDamage(this, null, Utility.RandomMinMax(5, 10), DamageType.Hull); Animate(1, 6, 1, true, false, 0); Effects.PlaySound(location, map, Utility.RandomList(0x134, 0x133)); }); } } }
public override void OnThink() { base.OnThink(); if (Utility.RandomDouble() < .05 && DateTime.UtcNow > m_NextShipChewAllowed && ShipOccupied != null) { if (ShipOccupied.Deleted) { return; } if (ShipOccupied.m_SinkTimer != null) { return; } ShipOccupied.ReceiveDamage(this, null, Utility.RandomMinMax(10, 20), DamageType.Hull); Say("*chews on the ship*"); SpecialAbilities.HinderSpecialAbility(1.0, this, this, 1.0, 1, true, Utility.RandomList(0x134, 0x133), false, "", "", "-1"); m_NextShipChewAllowed = DateTime.UtcNow + NextShipChewDelay; } }