Exemplo n.º 1
0
    private void SetMenuOptions(int actorID, int itemID)
    {
        if (!MenuSystem.RemoveOptions(actorID, AllMenuOptions))
        {
            return;
        }

        if (!TargetWithinRange(MenuSystem.DistanceToTarget(actorID)))
        {
            return;
        }

        // Check for AttackComponent

        MenuSystem.AddOption(actorID, RPGGameEvent.Menu_AttackMelee);
    }
Exemplo n.º 2
0
    private void SetMenuOptions(int actorID, int itemID)
    {
        if (!MenuSystem.RemoveOptions(actorID, AllMenuOptions))
        {
            return;
        }

        if (ActionSystem.IsBusy(actorID))
        {
            return;
        }

        if (!ItemWithinRange(MenuSystem.DistanceToTarget(actorID)))
        {
            return;
        }

        var lockComp = this.EntityManager.GetComponent <LockComponent>(itemID); if (lockComp == null)
        {
            return;
        }

        bool unlockOptionExists = false;

        if (lockComp.IsPickable && !lockComp.PickLockAttempted(actorID)) // IF lock is pickable AND actor has not attempted to pick this lock...
        {
            var skill = this.EntityManager.GetComponent <SkillComponent>(actorID);
            if (skill != null && skill.PickLockLevel >= 0) // ...AND actor can pick locks THEN add option
            {
                MenuSystem.AddOption(actorID, RPGGameEvent.Menu_PickLock);
                unlockOptionExists = true;
            }
        }
        if (lockComp.HasKey && ActorHasKey(actorID, lockComp.KeyEntityID))
        {
            MenuSystem.AddOption(actorID, RPGGameEvent.Menu_UseKey);
            unlockOptionExists = true;
        }
        if (!unlockOptionExists)
        {
            MenuSystem.AddOption(actorID, RPGGameEvent.Menu_Locked);
        }
    }
Exemplo n.º 3
0
    private void SetMenuOptions(int actorID, int itemID)
    {
        if (!MenuSystem.RemoveOptions(actorID, AllMenuOptions))
        {
            return;
        }

        if (ActionSystem.IsBusy(actorID))
        {
            return;
        }

        if (!ItemWithinRange(MenuSystem.DistanceToTarget(actorID)))
        {
            return;
        }

        var trap = this.EntityManager.GetComponent <TrapComponent>(itemID); if (trap == null)

        {
            return;
        }

        // Not Detected
        if (!trap.IsDetectedBy(actorID))
        {
            return;
        }

        // No disarm skill or already tried to disarm?
        var skill = this.EntityManager.GetComponent <SkillComponent>(actorID);

        if (skill == null || skill.TrapDisarmLevel == 0 || trap.DisarmAttempted(actorID))
        {
            MenuSystem.AddOption(actorID, RPGGameEvent.Menu_TrapDetected);
        }
        else // Can try disarming
        {
            MenuSystem.AddOption(actorID, RPGGameEvent.Menu_DisarmTrap);
        }
    }
Exemplo n.º 4
0
    private void SetMenuOptions(int actorID, int itemID)
    {
        if (!MenuSystem.RemoveOptions(actorID, AllMenuOptions))
        {
            return;
        }

        if (ActionSystem.IsBusy(actorID))
        {
            return;
        }

        if (!ItemWithinRange(MenuSystem.DistanceToTarget(actorID)))
        {
            return;
        }

        if (LockSystem.IsLocked(itemID))
        {
            return;
        }

        MenuSystem.AddOption(actorID, IsOpen(itemID) ? RPGGameEvent.Menu_Close : RPGGameEvent.Menu_Open);
    }