public override bool SpiritPowerEquals(SpiritPower power)
 {
     if (power.GetType() == typeof(SpiritPingPong)) {
         return true;
     }
     return false;
 }
Example #2
0
    // METHODS -----
    new void Start()
    {
        base.Start();
        _weaponTrail = GetComponentInChildren<TrailRenderer>();
        _attackPlanePoint = GetComponentInChildren<PlaneSpawner>();

        SoundController = GetComponent<RandomSoundPlayer>();

        CollectRadius += 1;

        // TESTING
        AddEffectToWeapons(new Damage(25));

        ui = GameObject.Find("UI").GetComponent<SpiritMeterUI>();
        if (DashEnabled) {
            _dashTrail = GetComponent<TrailRenderer> ();
        }
        _mainCamera = GameObject.FindGameObjectWithTag("MainCamera").camera;
        _reviveHeartPrefab = (GameObject) Resources.Load("ReviveHeart");

        //currentSpiritPower = gameObject.AddComponent<SpiritBungie>();
        //currentSpiritPower = gameObject.AddComponent<SpiritLightning>();
        //currentSpiritPower = gameObject.AddComponent<SpiritPingPong>();
        //currentSpiritPower = gameObject.AddComponent<SpiritImmortal>();

        currentSpiritPower = gameObject.AddComponent<SpiritBungie>();

        aspect = GetComponentInChildren<EntityRig>().Entity.GetAspect("twinhero");

        //Search for menu settings
        GameObject levelInfo = GameObject.Find("LevelCreationInfo");
        if (levelInfo != null) {
            spiritRegen = levelInfo.GetComponent<LevelCreationInfo>().spiritRegen;
            _damageRecievedModifier = levelInfo.GetComponent<LevelCreationInfo>().DamageRecievedModifier;
        }
    }
Example #3
0
 public void ChangeSpiritPower(SpiritPower newPower)
 {
     DeactivateSpiritPower(true);
     currentSpiritPower.OnDeactivateSync(this, otherPlayer, true);
     Destroy(currentSpiritPower);
     currentSpiritPower = newPower;
     ui.UpdateSpiritPowerIcons();
 }
 void ColorizeSpiritMeter(GameObject spiritMeter, SpiritPower spiritPower, float amount)
 {
     if (amount < spiritPower.GetCostActivate())
         spiritMeter.renderer.material.SetColor("_Color", Color.red);
     else if (amount >= spiritPower.GetCostActivateSync())
         spiritMeter.renderer.material.SetColor("_Color",  new Color(1f, 1f, 0f));
     else
         spiritMeter.renderer.material.SetColor("_Color", new Color(1f, 0.3f, 0f));
 }
 public abstract bool SpiritPowerEquals(SpiritPower power);
 private GameObject FindSpiritPowerGO(SpiritPower power)
 {
     foreach (var spiritPower in SpiritPowers) {
         var collectable = spiritPower.GetComponent<CollectableSpiritPower>();
         if (collectable.SpiritPowerEquals(power)) {
             return spiritPower;
         }
     }
     return null;
 }