public BombBlast(Point3D location, Map map, BlastDirection direction, BombBag bombbag, Mobile planter, int strength, bool baddaboom) { _Direction = direction; _DeltaX = (_Direction == BlastDirection.West ? -1 : 0) + (_Direction == BlastDirection.East ? 1 : 0); _DeltaY = (_Direction == BlastDirection.North ? -1 : 0) + (_Direction == BlastDirection.South ? 1 : 0); _Location = new Point3D(location.X + _DeltaX, location.Y + _DeltaY, location.Z); _Map = map; _BombBag = bombbag; _Planter = planter; _Strength = strength; _BaddaBoom = baddaboom; _BlastTimer = new BlastTimer(this); _BlastTimer.Start(); //check for any victims of the blast if (_BombBag != null && !_BombBag.Deleted) { _BombBag.ControlItem.CheckForMobileVictims(_Location, _Map, _BombBag); } }
//master constructor public Bomb( BombBag bombbag ) : base( 0x2256, bombbag == null ? "Bomb" : bombbag.Owner.Name + "'s Bomb" ) { Hue = 1; //link this bomb up to the bomb bag it came from BombBag = bombbag; Planter = BombBag.Owner; _Strength = BombBag.BombStrength; if( BombBag.BaddaBoom ) { _BaddaBoom = new BaddaBoom( this ); } else { _Candle = new BombCandle( this ); } if( BombBag.Detonator != null ) { _Detonator = new DetonatorReceiver( this ); } else { StartFuse(); } }
//master constructor public Bomb(BombBag bombbag) : base(0x2256, bombbag == null ? "Bomb" : bombbag.Owner.Name + "'s Bomb") { Hue = 1; //link this bomb up to the bomb bag it came from BombBag = bombbag; Planter = BombBag.Owner; _Strength = BombBag.BombStrength; if (BombBag.BaddaBoom) { _BaddaBoom = new BaddaBoom(this); } else { _Candle = new BombCandle(this); } if (BombBag.Detonator != null) { _Detonator = new DetonatorReceiver(this); } else { StartFuse(); } }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); _BombBag = (BombBag)reader.ReadItem(); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); _BombBag = (BombBag)reader.ReadItem(); }
//master constructor public BombDetonator( BombBag bag ) : base( 0xFC1 ) { _BombBag = bag; Hue = 1161; Name = "Detonator"; //locked down in backpack Movable = false; Active = true; }
//master constructor public BombDetonator(BombBag bag) : base(0xFC1) { _BombBag = bag; Hue = 1161; Name = "Detonator"; //locked down in backpack Movable = false; Active = true; }
protected override void Upgrade(Mobile m) { base.Upgrade(m); BombBag bag = (BombBag)m.Backpack.FindItemByType(typeof(BombBag)); if (bag != null) { bag.BombStrength += 1; } }
protected override void Upgrade(Mobile m) { base.Upgrade(m); BombBag bag = (BombBag)m.Backpack.FindItemByType(typeof(BombBag)); if (bag != null) { bag.SpeedBoost(); } }
protected override void Upgrade(Mobile m) { base.Upgrade(m); BombBag bag = (BombBag)m.Backpack.FindItemByType(typeof(BombBag)); if (bag != null && bag.Detonator == null) { BombDetonator detonator = new BombDetonator(bag); bag.Detonator = detonator; m.Backpack.DropItem(detonator); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); BombBag = (BombBag)reader.ReadItem(); _Strength = reader.ReadInt(); _Candle = (BombCandle)reader.ReadItem(); _Detonator = (DetonatorReceiver)reader.ReadItem(); _BaddaBoom = (BaddaBoom)reader.ReadItem(); if (_Detonator == null) { StartFuse(); } }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); BombBag = (BombBag)reader.ReadItem(); _Strength = reader.ReadInt(); _Candle = (BombCandle)reader.ReadItem(); _Detonator = (DetonatorReceiver)reader.ReadItem(); _BaddaBoom = (BaddaBoom)reader.ReadItem(); if( _Detonator == null ) { StartFuse(); } }
public void CheckForMobileVictims( Point3D location, Map map, BombBag sourcebag ) { IPooledEnumerable ie = map.GetMobilesInRange( location, 0 ); List<Mobile> tomove = new List<Mobile>(); foreach( Mobile m in ie ) { if( Players.IndexOf( m ) > -1 ) { if( m != sourcebag.Owner ) { m.SendMessage( "You've been blown up by " + sourcebag.Owner.Name + "'s blast!" ); //handle scoring BoardGameData.ChangeScore( GameName, sourcebag.Owner, BombermanSettings.KILL_SCORE ); BoardGameData.ChangeScore( GameName, m, BombermanSettings.DEATH_SCORE ); BoardGameData.AddLose( GameName, m ); } else { m.SendMessage( "You just blew yourself up!!" ); BoardGameData.ChangeScore( GameName, m, BombermanSettings.SUICIDE_SCORE ); } m.PlaySound( m.Female? 0x32E : 0x549 ); //0x54A - yelp1 tomove.Add( m ); } } ie.Free(); foreach( Mobile m in tomove ) { m.MoveToWorld( new Point3D( X - 1, Y - 1, Z ), Map ); m.SendGump( new BoardGameLostGump( m, this ) ); Players.Remove( m ); BombBag bag = (BombBag)m.Backpack.FindItemByType( typeof( BombBag ) ); if( bag != null ) { //don't let players run around blowing stuff up outside the game while they wait for others to finish bag.Active = false; } //start the timer to check for endgame, delay for 1s } //test big bomb chain! StartEndGameTimer( TimeSpan.FromSeconds( 1 ) ); }
protected override void PrimePlayers() { base.PrimePlayers(); for( int i = 0; i < Players.Count; i++ ) { Mobile player = Players[i]; Point3D movepoint; switch( i ) { case 0: { movepoint = new Point3D( X + BoardOffset.X + 1, Y + BoardOffset.Y + 1, Z + BoardOffset.Z ); break; } case 1: { movepoint = new Point3D( X + BoardOffset.X + BoardWidth - 2, Y + BoardOffset.Y + 1, Z + BoardOffset.Z ); break; } case 2: { movepoint = new Point3D( X + BoardOffset.X + 1, Y + BoardOffset.Y + BoardHeight - 2, Z + BoardOffset.Z ); break; } case 3: { movepoint = new Point3D( X + BoardOffset.X + + BoardWidth - 2, Y + BoardOffset.Y + + BoardHeight - 2, Z + BoardOffset.Z ); break; } case 4: { movepoint = new Point3D( X + BoardOffset.X + BoardWidth / 2, Y + BoardOffset.Y + 1, Z + BoardOffset.Z ); break; } case 5: { movepoint = new Point3D( X + BoardOffset.X + BoardWidth - 2, Y + BoardOffset.Y + BoardHeight / 2, Z + BoardOffset.Z ); break; } case 6: { movepoint = new Point3D( X + BoardOffset.X + BoardWidth / 2, Y + BoardOffset.Y + BoardHeight - 2, Z + BoardOffset.Z ); break; } case 7: default: { movepoint = new Point3D( X + BoardOffset.X + 1, Y + BoardOffset.Y + BoardHeight / 2, Z + BoardOffset.Z ); break; } } player.MoveToWorld( movepoint, BoardMap ); BombBag bag = new BombBag( this, _DefaultMaxBombs, _DefaultBombStrength ); BombBags.Add( bag ); bag.Owner = player; player.Backpack.DropItem( bag ); if( _DefaultDetonatorMode ) { BombDetonator detonator = new BombDetonator( bag ); bag.Detonator = detonator; player.Backpack.DropItem( detonator ); } bag.BaddaBoom = _DefaultBaddaBoom; } }