Example #1
0
 public static bool UnlockAbility(NodeAbility ability)
 {
     if (!unlockedAbilities.Contains(ability))
     {
         unlockedAbilities.Add(ability);
         return true;
     }
     return false;
 }
Example #2
0
    public void UnlockAbility(NodeAbility _toUnlock)
    {
        switch (_toUnlock.name) {
        case "growth":
            {
                growth.UnlockAbillity ();
                break;
            }
        case "slowdown":
            {
                slowdown.UnlockAbillity ();
                break;
            }
        case "speedup":
            {
                speedup.UnlockAbillity ();
                break;
            }
        case "zombie":
            {
                zombies.UnlockAbillity ();
                break;
            }

        default:
            {
                Debug.Log ("Something went wrong");
                break;
            }

        }
        UserMenu.current.UpdateEnabledAbilities ();
    }
Example #3
0
 void Start()
 {
     plane = new Plane(Vector3.up, Vector3.zero);
     cam = Camera.main;
     currentState = InputState.NoMode;
     eventsystem = EventSystem.current;
     selectedSkill = FungusResources.Instance.attract;
 }
Example #4
0
 public void SelectSkill(UserMenu.AbilityType _button)
 {
     currentState = InputState.SkillMode;
     switch (_button)
     {
         case UserMenu.AbilityType.Lure:
             if (FungusResources.Instance.attract.isUnlocked)
             {
                 selectedSkill = FungusResources.Instance.attract;
             }
             break;
         case UserMenu.AbilityType.Eat:
             if (FungusResources.Instance.beatneat.isUnlocked)
             {
                 selectedSkill = FungusResources.Instance.beatneat;
             }
             break;
         case UserMenu.AbilityType.Spawn:
             if (FungusResources.Instance.growth.isUnlocked)
             {
                 selectedSkill = FungusResources.Instance.growth;
             }
             break;
         case UserMenu.AbilityType.Slow:
             if (FungusResources.Instance.slowdown.isUnlocked)
             {
                 selectedSkill = FungusResources.Instance.slowdown;
             }
             break;
         case UserMenu.AbilityType.Speedup:
             if (FungusResources.Instance.speedup.isUnlocked)
             {
                 selectedSkill = FungusResources.Instance.speedup;
             }
             break;
         case UserMenu.AbilityType.Enslave:
             if (FungusResources.Instance.zombies.isUnlocked)
             {
                 selectedSkill = FungusResources.Instance.zombies;
             }
             break;
         default:
             Debug.Log("Something went wrong");
             selectedSkill = null;
             break;
     }
 }
Example #5
0
 protected override void OnStart()
 {
     world.SetPositionIsSlime (transform.position, StandardGameSettings.Get.nodeSlimeExtend, true);
     CreateConnections ();
     IsActive = false;
     attackTimer = 0.0f;
     abilityDisplay = GetComponentInChildren<SpriteRenderer> ();
     ability = Instantiate (ability);
 }
Example #6
0
 public void Specialize(NodeAbility newAbility)
 {
     ability.StopExecution (this);
     ability = Instantiate (newAbility);
     abilityDisplay.color = ability.color;
 }
Example #7
0
 void OnAbilityGained(NodeAbility ability)
 {
     if (EventActions.Count == 0) return;
     var he = new HookEventInfo() { LinkedAbility = ability, type = TutorialEventType.AbilityGained };
     if (CallActions(he))
     {
         AbilityBuilding.OnAbilityGained -= OnAbilityGained;
     }
 }