Beispiel #1
0
 public void Attacking(int num)
 {
     if (Fire)
     {
         GolemEnemy = ScriptObject.GetComponent <FireGolem>();
         if (num == 1)
         {
             GolemEnemy.Attacked(true);
         }
         else
         {
             GolemEnemy.Attacked(false);
         }
     }
     else if (Ice)
     {
         GolemEnemy2 = ScriptObject.GetComponent <IceGolem>();
         if (num == 1)
         {
             GolemEnemy2.Attacked(true);
         }
         else
         {
             GolemEnemy2.Attacked(false);
         }
     }
 }
Beispiel #2
0
 public void StartWalking(int num)
 {
     if (Fire)
     {
         if (num > 0)
         {
             shake      = false;
             GolemEnemy = ScriptObject.GetComponent <FireGolem>();
             GolemEnemy.SwitchState(FireGolem.EnemyState.isWalking);
         }
         else
         {
             shake      = false;
             GolemEnemy = ScriptObject.GetComponent <FireGolem>();
             GolemEnemy.SwitchState(FireGolem.EnemyState.notWalking);
         }
     }
     else if (Ice)
     {
         if (num > 0)
         {
             shake       = false;
             GolemEnemy2 = ScriptObject.GetComponent <IceGolem>();
             GolemEnemy2.SwitchState(IceGolem.EnemyState.isWalking);
         }
         else
         {
             shake       = false;
             GolemEnemy2 = ScriptObject.GetComponent <IceGolem>();
             GolemEnemy2.SwitchState(IceGolem.EnemyState.notWalking);
         }
     }
 }
 private void OnCollisionEnter(Collision other)
 {
     if (other.gameObject.CompareTag("FireGolem"))
     {
         fireGolem = other.gameObject.GetComponent <FireGolem>();
         if (fireGolem != null)
         {
             fireGolem.DoDamage(1);
         }
     }
     else if (other.gameObject.CompareTag("IceGolem"))
     {
         iceGolem = other.gameObject.GetComponent <IceGolem>();
         if (iceGolem != null)
         {
             iceGolem.DoDamage(6);
         }
     }
     else if (other.gameObject.CompareTag("Eye"))
     {
         EyeEnemy = other.gameObject.GetComponent <EyeEnemy>();
         if (EyeEnemy != null)
         {
             EyeEnemy.DoDamage(3);
         }
     }
     else if (other.gameObject.CompareTag("GhostBoss"))
     {
         GhostBoss = other.gameObject.GetComponent <GhostBoss>();
         if (GhostBoss != null)
         {
             GhostBoss.DoDamage(3);
         }
     }
     else if (other.gameObject.CompareTag("EnemyPhantom"))
     {
         PhantomEnemy = other.gameObject.GetComponent <PhantomEnemy>();
         if (PhantomEnemy != null)
         {
             PhantomEnemy.DoDamage(3);
         }
     }
     else if (other.gameObject.CompareTag("FinalBoss"))
     {
         rb.velocity   = Vector3.zero;
         rb.useGravity = true;
     }
     else if (other.gameObject.CompareTag("BossIceField"))
     {
         Destroy(gameObject);
     }
     else
     {
         rb.constraints = RigidbodyConstraints.FreezeAll;
         Destroy(gameObject, 3);
     }
 }
Beispiel #4
0
        public override void OnDoubleClick(Mobile from)
        {
            Container pack = from.Backpack;

            if (!(pack != null && Parent == pack))
            {
                from.SendLocalizedMessage(1080058);                   // This must be in your backpack to use it.
                return;
            }
            else if (!(from is PlayerMobile))
            {
                return;
            }

            List <Mobile> pets      = ((PlayerMobile)from).AllFollowers;
            bool          cansummon = true;

            for (int i = 0; i < pets.Count; i++)
            {
                if (pets[i] is BloodGolem || pets[i] is ClayGolem || pets[i] is IronGolem || pets[i] is FireGolem)
                {
                    cansummon = false;
                    break;
                }
            }

            if (!cansummon)
            {
                from.SendMessage("You can only summon one golem at any given time.");
                return;
            }

            BaseCreature bc = null;

            switch (m_Golem)
            {
            case GolemType.Blood: bc = new BloodGolem(); break;

            case GolemType.Clay: bc = new ClayGolem(); break;

            case GolemType.Iron: { from.Target = new InternalTarget(this); } break;

            case GolemType.Fire: bc = new FireGolem(); break;
            }

            if (bc != null)
            {
                bc.SetControlMaster(from);
                from.SendMessage(1192, "You summon the golem.");
                bc.MoveToWorld(new Point3D(from.X + Utility.RandomMinMax(-1, 1), from.Y + Utility.RandomMinMax(-1, 1), from.Z), from.Map);
                Delete();
            }
        }
    private void OnCollisionEnter(Collision other)
    {
        if (other.gameObject.CompareTag("FireGolem"))
        {
            rb.velocity   = Vector3.zero;
            rb.useGravity = true;

            fireGolem = other.gameObject.GetComponent <FireGolem>();
            if (fireGolem != null)
            {
                fireGolem.DoDamage(4);
                Destroy(gameObject, 2);
            }
        }
        else if (other.gameObject.CompareTag("IceGolem"))
        {
            rb.velocity   = Vector3.zero;
            rb.useGravity = true;

            iceGolem = other.gameObject.GetComponent <IceGolem>();
            if (iceGolem != null)
            {
                iceGolem.DoDamage(4);
                Destroy(gameObject, 2);
            }
        }
        else if (other.gameObject.CompareTag("Eye"))
        {
            rb.velocity   = Vector3.zero;
            rb.useGravity = true;
            enemy         = other.gameObject.GetComponent <EyeEnemy>();
            if (enemy != null)
            {
                enemy.DoDamage(4);
                Destroy(gameObject, 2);
            }
        }
        else if (other.gameObject.CompareTag("GhostBoss"))
        {
            rb.velocity   = Vector3.zero;
            rb.useGravity = true;

            GhostBoss = other.gameObject.GetComponent <GhostBoss>();
            if (GhostBoss != null)
            {
                GhostBoss.DoDamage(4);
                Destroy(gameObject, 2);
            }
        }
        else if (other.gameObject.CompareTag("EnemyPhantom"))
        {
            rb.velocity   = Vector3.zero;
            rb.useGravity = true;

            PhantomEnemy = other.gameObject.GetComponent <PhantomEnemy>();
            if (PhantomEnemy != null)
            {
                PhantomEnemy.DoDamage(4);
                Destroy(gameObject, 2);
            }
        }
        else if (other.gameObject.CompareTag("FinalBoss"))
        {
            rb.useGravity = true;
        }
        else if (other.gameObject.CompareTag("BossIceField"))
        {
            Destroy(gameObject);
        }
    }