Beispiel #1
0
        public void DoDamage(PBGrenade nade, Mobile defender)
        {
            PBArmor armor;

            armor = defender.NeckArmor as PBArmor;

            if (defender.FindItemOnLayer(Layer.Cloak) == null)
            {
                if (m_PBGI != null)
                {
                    m_PBGI.KillPlayer(defender);
                    defender.SendMessage("You are not on a team!  Removing you from the game.");
                }
                defender.SendMessage("Error: PBGI returns null. You are not in the game, Please Rejoin or contact a GM.");
            }

            int defenderTeam = defender.FindItemOnLayer(Layer.Cloak).Hue;

            for (int i = 0; i < m_PBGI.NadeDamage; ++i)
            {
                if (defender.NeckArmor != null && defender.NeckArmor.Hue == defenderTeam)
                {
                    armor = defender.NeckArmor as PBArmor;
                }
                else if (defender.HandArmor != null && defender.HandArmor.Hue == defenderTeam)
                {
                    armor = defender.HandArmor as PBArmor;
                }
                else if (defender.ArmsArmor != null && defender.ArmsArmor.Hue == defenderTeam)
                {
                    armor = defender.ArmsArmor as PBArmor;
                }
                else if (defender.HeadArmor != null && defender.HeadArmor.Hue == defenderTeam)
                {
                    armor = defender.HeadArmor as PBArmor;
                }
                else if (defender.LegsArmor != null && defender.LegsArmor.Hue == defenderTeam)
                {
                    armor = defender.LegsArmor as PBArmor;
                }
                else if (defender.ChestArmor != null && defender.ChestArmor.Hue == defenderTeam)
                {
                    armor = defender.ChestArmor as PBArmor;
                }
                else
                {
                    m_PBGI.KillPlayer(defender);
                }


                armor.WasHit(this, 0);

                //armor.NadeHit( nade, 0 );
            }
        }
Beispiel #2
0
		public void DoDamage(PBGrenade nade, Mobile defender)
		{
			PBArmor armor;
			armor = defender.NeckArmor as PBArmor;
			
			if( defender.FindItemOnLayer( Layer.Cloak ) == null )
			{
				if (m_PBGI != null )
				{
				m_PBGI.KillPlayer( defender );
				defender.SendMessage( "You are not on a team!  Removing you from the game." );
				}
				defender.SendMessage( "Error: PBGI returns null. You are not in the game, Please Rejoin or contact a GM." );
				
			}

			int defenderTeam = defender.FindItemOnLayer( Layer.Cloak ).Hue;
			
for ( int i = 0; i < m_PBGI.NadeDamage ; ++i )
			{
			if( defender.NeckArmor != null && defender.NeckArmor.Hue == defenderTeam )
				armor = defender.NeckArmor as PBArmor;
			else if( defender.HandArmor != null && defender.HandArmor.Hue == defenderTeam )
				armor = defender.HandArmor as PBArmor;
			else if( defender.ArmsArmor != null && defender.ArmsArmor.Hue == defenderTeam )
				armor = defender.ArmsArmor as PBArmor;
			else if( defender.HeadArmor != null && defender.HeadArmor.Hue == defenderTeam )
				armor = defender.HeadArmor as PBArmor;
			else if( defender.LegsArmor != null && defender.LegsArmor.Hue == defenderTeam )
				armor = defender.LegsArmor as PBArmor;
			else if( defender.ChestArmor != null && defender.ChestArmor.Hue == defenderTeam )
				armor = defender.ChestArmor as PBArmor;
			else
			{
				
				m_PBGI.KillPlayer( defender );
			
			}


			armor.WasHit( this, 0 );
		
			//armor.NadeHit( nade, 0 );
}
		}
Beispiel #3
0
		public void DoDamage(PBGrenade nade, Mobile attacker, Mobile defender)
		{
			
			
			if( defender.FindItemOnLayer( Layer.Cloak ) == null )
			{
				if (m_PBGI != null )
				{
				m_PBGI.KillPlayer( defender );
				defender.SendMessage( "You are not on a team!  Removing you from the game." );
				}
				defender.SendMessage( "Error: PBGI returns null. You are not in the game, Please Rejoin or contact a GM." );
				
			}
			else
			{
			PBArmor armor;
			//armor = defender.NeckArmor as PBArmor;

			int defenderTeam = defender.FindItemOnLayer( Layer.Cloak ).Hue;
			int attackerTeam = attacker.FindItemOnLayer( Layer.Cloak ).Hue;
			
			if ( attackerTeam == defenderTeam )
				{
				attacker.SendMessage( "You are sprayed with paint from you`re own grenade." );
			    }
			else
				{
			
for ( int i = 0; i < m_PBGI.NadeDamage ; ++i )
		{
			if( defender.NeckArmor != null && defender.NeckArmor.Hue == defenderTeam )
			{
				armor = defender.NeckArmor as PBArmor;
				armor.WasHit( this, 0 );
			}
			else if( defender.HandArmor != null && defender.HandArmor.Hue == defenderTeam )
			{
				armor = defender.HandArmor as PBArmor;
				armor.WasHit( this, 0 );
			}
			else if( defender.ArmsArmor != null && defender.ArmsArmor.Hue == defenderTeam )
			{
				armor = defender.ArmsArmor as PBArmor;
				armor.WasHit( this, 0 );
			}
			else if( defender.HeadArmor != null && defender.HeadArmor.Hue == defenderTeam )
			{
				armor = defender.HeadArmor as PBArmor;
				armor.WasHit( this, 0 );
			}
			else if( defender.LegsArmor != null && defender.LegsArmor.Hue == defenderTeam )
			{
				armor = defender.LegsArmor as PBArmor;
				armor.WasHit( this, 0 );
			}
			else if( defender.ChestArmor != null && defender.ChestArmor.Hue == defenderTeam )
			{
				armor = defender.ChestArmor as PBArmor;
				armor.WasHit( this, 0 );
			}
			else
			{
				attacker.SendMessage( "You have just removed that player from the game!" );
				m_PBGI.KillPlayer( defender );
			
			}


			//armor.WasHit( this, 0 );
		
			//armor.NadeHit( nade, 0 );
			}
		}
	}
}
Beispiel #4
0
			public ThrowTarget( PBGrenade nade ) : base( 12, true, TargetFlags.None )
			{
				m_Nade = nade;
			}
Beispiel #5
0
        public void DoDamage(PBGrenade nade, Mobile attacker, Mobile defender)
        {
            if (defender.FindItemOnLayer(Layer.Cloak) == null)
            {
                if (m_PBGI != null)
                {
                    m_PBGI.KillPlayer(defender);
                    defender.SendMessage("You are not on a team!  Removing you from the game.");
                }
                defender.SendMessage("Error: PBGI returns null. You are not in the game, Please Rejoin or contact a GM.");
            }
            else
            {
                PBArmor armor;
                //armor = defender.NeckArmor as PBArmor;

                int defenderTeam = defender.FindItemOnLayer(Layer.Cloak).Hue;
                int attackerTeam = attacker.FindItemOnLayer(Layer.Cloak).Hue;

                if (attackerTeam == defenderTeam)
                {
                    attacker.SendMessage("You are sprayed with paint from you`re own grenade.");
                }
                else
                {
                    for (int i = 0; i < m_PBGI.NadeDamage; ++i)
                    {
                        if (defender.NeckArmor != null && defender.NeckArmor.Hue == defenderTeam)
                        {
                            armor = defender.NeckArmor as PBArmor;
                            armor.WasHit(this, 0);
                        }
                        else if (defender.HandArmor != null && defender.HandArmor.Hue == defenderTeam)
                        {
                            armor = defender.HandArmor as PBArmor;
                            armor.WasHit(this, 0);
                        }
                        else if (defender.ArmsArmor != null && defender.ArmsArmor.Hue == defenderTeam)
                        {
                            armor = defender.ArmsArmor as PBArmor;
                            armor.WasHit(this, 0);
                        }
                        else if (defender.HeadArmor != null && defender.HeadArmor.Hue == defenderTeam)
                        {
                            armor = defender.HeadArmor as PBArmor;
                            armor.WasHit(this, 0);
                        }
                        else if (defender.LegsArmor != null && defender.LegsArmor.Hue == defenderTeam)
                        {
                            armor = defender.LegsArmor as PBArmor;
                            armor.WasHit(this, 0);
                        }
                        else if (defender.ChestArmor != null && defender.ChestArmor.Hue == defenderTeam)
                        {
                            armor = defender.ChestArmor as PBArmor;
                            armor.WasHit(this, 0);
                        }
                        else
                        {
                            attacker.SendMessage("You have just removed that player from the game!");
                            m_PBGI.KillPlayer(defender);
                        }


                        //armor.WasHit( this, 0 );

                        //armor.NadeHit( nade, 0 );
                    }
                }
            }
        }
Beispiel #6
0
        public void Explode(Mobile from, bool direct, Point3D loc, Map map)
        {
            PBGrenade nade = this;

            if (Deleted)
            {
                return;
            }

            Consume();

            for (int i = 0; m_Users != null && i < m_Users.Count; ++i)
            {
                Mobile      m    = (Mobile)m_Users[i];
                ThrowTarget targ = m.Target as ThrowTarget;

                if (targ != null && targ.Nade == this)
                {
                    Target.Cancel(m);
                }
            }

            if (map == null)
            {
                return;
            }

            Effects.PlaySound(loc, map, 0x207);
            Effects.SendLocationEffect(loc, map, 0x36BD, 35, this.Hue, 0);

            int alchemyBonus = 0;

            if (direct)
            {
                alchemyBonus = (int)(from.Skills.Alchemy.Value / (Core.AOS ? 5 : 10));
            }

            IPooledEnumerable eable     = LeveledExplosion ? map.GetObjectsInRange(loc, ExplosionRange) : map.GetMobilesInRange(loc, ExplosionRange);
            ArrayList         toExplode = new ArrayList();

            int toDamage = 0;

            foreach (object o in eable)
            {
                if (o is Mobile)
                {
                    toExplode.Add(o);
                    ++toDamage;
                }
                else if (o is PBGrenade && o != this)
                {
                    toExplode.Add(o);
                }
            }

            eable.Free();



            for (int i = 0; i < toExplode.Count; ++i)
            {
                object o = toExplode[i];

                if (o is Mobile)
                {
                    Mobile m = (Mobile)o;

                    if (from == null || (SpellHelper.ValidIndirectTarget(from, m) && from.CanBeHarmful(m, false)))
                    {
                        if (from != null)
                        {
                            //from.DoHarmful( m );

                            if (m_PBGI.Players.Contains(m) || m_PBGI.NpcPlayers.Contains(m))
                            {
                                DoDamage(nade, from, m);
                            }
                            else
                            {
                                from.SendMessage("You cannot attack someone that is not playing!");
                                m.SendMessage("You are not playing Paintball, please leave the area.");
                            }
                        }



                        /*
                         *
                         * if ( !Core.AOS && damage > 40 )
                         *      damage = 40;
                         * else if ( Core.AOS && toDamage > 2 )
                         *      damage /= toDamage - 1;
                         *
                         * AOS.Damage( m, from, damage, 0, 100, 0, 0, 0 ); */
                    }
                }
                else if (o is PBGrenade)
                {
                    PBGrenade pot = (PBGrenade)o;

                    pot.Explode(from, false, pot.GetWorldLocation(), pot.Map);
                }
                else
                {
                    DoDamage(nade, from);
                }
            }
        }
Beispiel #7
0
 public ThrowTarget(PBGrenade nade) : base(12, true, TargetFlags.None)
 {
     m_Nade = nade;
 }