public void _on_AbilitiesMenu_id_pressed(int id)
    {
        success = true;
        // GD.Print("eeeeeeeeeeee first");
        Crawler crawler = this.GetCrawler();

        Action action;

        if (id < bigNumber)
        {
            action = new ReachAttackAction(attackData[id]);
            // action = new AttackAction();
            // action = new AttackAction(attackData[id]);
        }
        else
        {
            action = (Action)Activator.CreateInstance(Type.GetType(abilities[id - bigNumber]));
        }

        if (action.Range.max == 0)
        {
            crawler.Model.SetPlayerAction(action);
            crawler.notPlayerTurn = true;
            crawler.ResetState();
        }
        else
        {
            AbilityTargetInputState to = this.GetNode <AbilityTargetInputState>("Targeting");
            to.action = action;
            crawler.ChangeState(to);
            return;
        }
    }
Esempio n. 2
0
    public void _on_ItemsMenu_id_pressed(int id)
    {
        success = true;
        Crawler crawler = this.GetCrawler();

        Action action = new UseItemAction(crawler.Model.GetPlayer(), 3458799);

        if (action.Range.max == 0)
        {
            crawler.Model.SetPlayerAction(action);
            crawler.notPlayerTurn = true;
            crawler.ResetState();
        }
        else
        {
            AbilityTargetInputState to = this.GetNode <AbilityTargetInputState>("Targeting");
            to.action = action;
            crawler.ChangeState(to);
            return;
        }
    }