コード例 #1
0
    private void AfterAssignDamage(EnemyCard attacker, int investigatorDamage, int allyDamage)
    {
        GameLogic.Get().m_afterAssignDamageEvent.RemoveListener(m_afterAssignDamage);

        UnityEngine.Assertions.Assert.IsNotNull(attacker, "Assert failed in core_guard_dog.AfterAssignDamage()!!!");

        if (allyDamage != 0)
        {
            GameLogic.Get().OutputGameLog(string.Format("<看门狗>对<{0}>发动反击\n", attacker.m_cardName));

            attacker.DecreaseHealth(1);
        }
    }
コード例 #2
0
    private IEnumerator _OnTargetDropdownChanged(int index)
    {
        var ui = GameLogic.Get().m_mainGameUI;

        ui.m_targetDropdown.onValueChanged.RemoveListener(m_onValueChanged);
        ui.m_targetDropdown.gameObject.SetActive(false);
        ui.m_actionDropdown.gameObject.SetActive(true);

        LocationCard location;

        if (index == 1)
        {
            location = Player.Get().m_currentLocation;
        }
        else
        {
            location = Player.Get().m_currentLocation.m_lstDestinations[index - 2];
        }

        GameLogic.Get().OutputGameLog(string.Format("{0}在<{1}>打出了<炸药爆破>!\n", Player.Get().m_investigatorCard.m_cardName, location.m_cardName));

        if (index == 1)
        {
            Player.Get().AssigningDamage(null, 3);
            GameLogic.Get().OutputGameLog(string.Format("{0}受到了3点伤害\n", Player.Get().m_investigatorCard.m_cardName));

            var engaged = Player.Get().GetEnemyCards();
            foreach (var enemy in engaged)
            {
                enemy.DecreaseHealth(3);
            }
        }

        location.m_lstCardsAtHere.ForEach((victim) =>
        {
            if (victim is EnemyCard)
            {
                EnemyCard enemy = victim as EnemyCard;
                enemy.DecreaseHealth(3);
            }
        });

        yield return(new WaitUntil(() => GameLogic.Get().m_currentTiming == EventTiming.None));

        Player.Get().m_currentAction.Pop();
    }