Esempio n. 1
0
        private void ExecuteActionHeal(ActionHeal action)
        {
            if (gManager.onlineGameInterface.WaitingForExpectedState())
            {
                gManager.onlineGameInterface.ForceEndReplayAction(); return;
            }

            CharacterBehaviorIHM character = GetTokenByNameAndPlayerId(action.tokenName, action.playerId).GetComponent <CharacterBehaviorIHM>();
            CharacterBehaviorIHM target    = GetTokenById(action.targetId).GetComponent <CharacterBehaviorIHM>();

            if (action.tokenName == "Troll")
            {
                Debug.Assert(character == target);
                Debug.Assert(character is CB_TrollIHM);
                character.characterSelection();
                character.GetComponent <CB_TrollIHM>().regenerate();
                gManager.onlineGameInterface.ForceEndReplayAction();
            }
            else if (action.tokenName == "Cleric")
            {
                Debug.Assert(character == target);
                Debug.Assert(character is CB_ClercIHM);
                character.characterSelection();
                character.GetComponent <CB_ClercIHM>().healCharacter();
                // TODO: the target seems not to be actually applied
                // EndReplay is done by the clerc
            }
            else
            {
                Debug.Assert(false, "Unexpected character type");
                gManager.onlineGameInterface.ForceEndReplayAction();
            }
        }
Esempio n. 2
0
        private void ExecuteActionDoor(ActionDoor action)
        {
            if (gManager.onlineGameInterface.WaitingForExpectedState())
            {
                gManager.onlineGameInterface.ForceEndReplayAction(); return;
            }

            CaseBehavior actionCharacterCell = gManager.getCase(action.y1, action.x1).GetComponent <CaseBehavior>();

            CharacterBehavior c = actionCharacterCell.getNonWoundedCharacter();

            Debug.Assert(c != null);
            CharacterBehaviorIHM character = c.GetComponent <CharacterBehaviorIHM>();

            character.characterSelection();
            if (action.action == ActionType.DESTROYDOOR)
            {
                Debug.Assert(character is CB_GuerrierIHM);
                character.GetComponent <CB_GuerrierIHM>().briserHerse();
            }
            else
            {
                Debug.Assert(character is CB_VoleuseIHM);
                character.GetComponent <CB_VoleuseIHM>().changerEtatHerse();
            }
            gManager.onlineGameInterface.ForceEndReplayAction();
        }