Beispiel #1
0
 void Awake()
 {
     if (!gasing)
     {
         gasing = GetComponent <Gasing>();
     }
     if (!gasing_pt)
     {
         gasing_pt = GetComponent <PhysicsTabrak>();
     }
 }
Beispiel #2
0
    public override void doSkill()
    {
        if (GamePrefs.isMultiplayer)
        {
            targetEnemies = mp_findAllTarget().ToArray();
        }
        else
        {
            targetEnemies = GameObject.FindGameObjectsWithTag("Enemy");
        }

        if (gasing.getSP() > skillPointNeeded)
        {
            if (targetEnemies.Length > 0)
            {
                foreach (GameObject targetEnemy in targetEnemies)
                {
                    StatusController targetEnemySC     = targetEnemy.GetComponent <StatusController>();
                    Gasing           targetEnemyGasing = targetEnemy.GetComponent <Gasing>();
                    PhysicsTabrak    targetEnemyPT     = targetEnemy.GetComponent <PhysicsTabrak>();
                    if (targetEnemySC)
                    {
                        targetEnemyGasing.EPKurang(targetEnemyGasing.energiPoint * 0.333f);
                        if (GamePrefs.isMultiplayer)
                        {
                            Network.Instantiate((GameObject)Resources.Load("Effect/Detonator-Simple"), targetEnemyGasing.transform.position, Quaternion.Euler(0, 0, 0), 20);
                        }
                        else
                        {
                            Instantiate((GameObject)Resources.Load("Effect/Detonator-Simple"), targetEnemyGasing.transform.position, Quaternion.Euler(0, 0, 0));
                        }
                        targetEnemySC.applyStatus("StatusStun", 2.5f);
                        Vector3 heading   = targetEnemyGasing.rigidbody.position - gasing.rigidbody.position;
                        Vector3 direction = heading / heading.magnitude;
                        Vector3 mdirXZ    = new Vector3(direction.x, 0, direction.z);
                        targetEnemySC.rigidbody.AddForce(mdirXZ * 4000);
                        targetEnemyPT.isInvicibleAfterClash = true;
                        targetEnemyPT.timeCountAfterClash   = 0f;
                        targetEnemyPT.geserForce            = 600 * mdirXZ;
                    }
                }
            }
            base.doSkill();
        }
    }
Beispiel #3
0
 void Awake()
 {
     if (!gasing)
     {
         gasing = GetComponent <Gasing>();
     }
     if (!gasing_pt)
     {
         gasing_pt = GetComponent <PhysicsTabrak>();
     }
     if (!skill_con)
     {
         skill_con = GetComponent <SkillController>();
     }
     speedAI   = 6000;
     time      = 0f;
     timeGerak = 0f;
     timeSkill = 0f;
 }