Esempio n. 1
0
    public int SkillTest(SkillType skill, int AgainstValue, Card target)
    {
        int chaosResult      = 0;
        int skillIconValue   = GetSkillIconNumInSelectCards(skill);
        int playerSkillValue = Player.Get().GetSkillValueByType(skill);

        ChaosBag.ChaosTokenType chaosToken = m_chaosBag.GetResult();

        switch (chaosToken)
        {
        case ChaosBag.ChaosTokenType.Tentacle:
            // Auto failed...
            chaosResult = -skillIconValue - playerSkillValue;
            break;

        case ChaosBag.ChaosTokenType.ElderSign:
            chaosResult = Player.Get().m_investigatorCard.GetComponent <InvestigatorLogic>().OnApplyElderSignEffect();
            break;

        case ChaosBag.ChaosTokenType.Zero:
        case ChaosBag.ChaosTokenType.Add_1:
        case ChaosBag.ChaosTokenType.Substract_1:
        case ChaosBag.ChaosTokenType.Substract_2:
        case ChaosBag.ChaosTokenType.Substract_3:
        case ChaosBag.ChaosTokenType.Substract_4:
        case ChaosBag.ChaosTokenType.Substract_5:
        case ChaosBag.ChaosTokenType.Substract_6:
        case ChaosBag.ChaosTokenType.Substract_7:
        case ChaosBag.ChaosTokenType.Substract_8:
            chaosResult = (int)chaosToken;
            break;

        default:
            chaosResult = m_currentScenario.GetChaosTokenEffect(chaosToken);
            break;
        }


        int finalValue = skillIconValue + chaosResult + playerSkillValue - AgainstValue;

        Card.m_lstSelectCards.ForEach(card =>
        {
            if (card.IsKeywordContain(Card.Keyword.Skill) && card.GetComponent <PlayerCardLogic>())
            {
                card.GetComponent <PlayerCardLogic>().OnSkillTest(finalValue);
            }
        });

        OutputGameLog(string.Format("技能检定如下:\n对应技能:<color=green>{0}</color>\n打出技能图标:<color=green>{1}</color>\n混沌标记<{2}>:<color=orange>{3}</color>\n检定值:<color=red>{4}</color>\n最终结果:{5}\n",
                                    playerSkillValue,
                                    skillIconValue,
                                    ChaosBag.GetChaosTokenName(chaosToken),
                                    chaosResult,
                                    -AgainstValue,
                                    finalValue));

        m_currentScenario.m_skillTest.AfterSkillTest(finalValue, chaosToken, target);

        return(finalValue);
    }
Esempio n. 2
0
 // Typically called from CampaignManager
 public void InitiateManager(ChaosBag chaosBag)
 {
     _currentChaosBag = chaosBag;
 }