Example #1
0
 void INewPlayerTurnListener.OnNewPlayerTurn()
 {
     TalentsHolderMgr.DecreasePenalty();
     bishopThornTrapSpell.Tick();
     BishopRootSpell.Tick();
     BishopWithholdEnemySpell.Tick();
 }
Example #2
0
    private void Awake()
    {
        talent = TalentsHolderMgr.GetTalent(spell);
        button = GetComponent <Button>();
        // will use that to disable
        skillIcon = gameObject.transform.GetChild(0).GetChild(0).gameObject;
        skillIcon.SetActive(true);

        currentPenaltyText = skillIcon.transform.GetChild(0).GetComponent <Text>();

        spellsPanel = gameObject.transform.parent.parent.gameObject; // parent of the parent
    }
Example #3
0
    public static void Activate(GameObject target)
    {
        duratation = 1;
        targetFsm  = target.GetComponent <PlayMakerFSM>();
        int freezePercentage = TalentsHolderMgr.GetTalent(EPlayerSpells.eBishopFreeze).GetBonusPercentage();
        int rnd = Random.Range(0, 100);

        if (rnd < freezePercentage)
        { // freeze
            freeze = true;
            targetFsm.Fsm.Event("SET_FROZEN");
            FxMgr.Instance.ActivateFreezeFX(target.transform.position);
        }
        else // root
        {
            targetFsm.Fsm.Event("SET_ROOTED");
            FxMgr.Instance.ActivateRootFX(target.transform.position);
        }
    }
Example #4
0
    public void UseSpell(EPlayerSpells spell)
    {
        TalentsHolderMgr.UseSpell(spell);
        switch (spell)
        {
        case EPlayerSpells.eKnightMoveUp:
        case EPlayerSpells.eKnightMoveDown:
        case EPlayerSpells.eKnightMoveLeft:
        case EPlayerSpells.eKnightMoveRight:
            knightMove.Activate(spell);
            break;

        case EPlayerSpells.eKnightInnerStrength:
            knightIS.Activate();
            break;

        case EPlayerSpells.eKnightSoulLink:
            knightSL.Activate();
            break;

        case EPlayerSpells.eBishopWithholdEnemy:
        case EPlayerSpells.eBishopEntangle:
        case EPlayerSpells.eBishopFreeze:
        case EPlayerSpells.eBishopInstantDeath:
            bishopPickEnemySpells.Activate(spell);
            break;

        case EPlayerSpells.eBishopPushUp:
        case EPlayerSpells.eBishopPushDown:
        case EPlayerSpells.eBishopPushLeft:
        case EPlayerSpells.eBishopPushRight:
            bishopPushEnemySpell.Activate(spell);
            break;

        case EPlayerSpells.eBishopThornTrap:
            bishopThornTrapSpell.Activate();
            break;

        case EPlayerSpells.eBishopClearTrap:
            bishopThornTrapSpell.ClearThornTrap();
            break;
        }
    }
Example #5
0
    void CreateKnightTalents()
    {
        talentButtons = new Dictionary <EPlayerSpells, TalentsPanelButton>
        {
            {
                EPlayerSpells.eKnightMoveLeft,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPenalties,
                    nActivationLevel = 4,
                    getTotalPoints   = TalentsHolderMgr.TotalKnightPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eKnightMoveLeft),
                    info             = FindStatsInfo(EPlayerSpells.eKnightMoveLeft),
                }
            },
            {
                EPlayerSpells.eKnightMoveRight,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPenalties,
                    nActivationLevel = 4,
                    getTotalPoints   = TalentsHolderMgr.TotalKnightPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eKnightMoveRight),
                    info             = FindStatsInfo(EPlayerSpells.eKnightMoveRight),
                }
            },

            {
                EPlayerSpells.eKnightMoveUp,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPenalties,
                    nActivationLevel = 0,
                    getTotalPoints   = TalentsHolderMgr.TotalKnightPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eKnightMoveUp),
                    info             = FindStatsInfo(EPlayerSpells.eKnightMoveUp),
                }
            },

            {
                EPlayerSpells.eKnightMoveDown,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPenalties,
                    nActivationLevel = 0,
                    getTotalPoints   = TalentsHolderMgr.TotalKnightPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eKnightMoveDown),
                    info             = FindStatsInfo(EPlayerSpells.eKnightMoveDown),
                }
            },

            {
                EPlayerSpells.eKnightSwiftJustice,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPenalties,
                    nActivationLevel = 8,
                    getTotalPoints   = TalentsHolderMgr.TotalKnightPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eKnightSwiftJustice),
                    info             = FindStatsInfo(EPlayerSpells.eKnightSwiftJustice),
                }
            },

            {
                EPlayerSpells.eKnightInnerStrength,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPenalties,
                    nActivationLevel = 12,
                    getTotalPoints   = TalentsHolderMgr.TotalKnightPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eKnightInnerStrength),
                    info             = FindStatsInfo(EPlayerSpells.eKnightInnerStrength),
                }
            },

            {
                EPlayerSpells.eKnightInnerStrengthEnhanced,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPercentage,
                    nActivationLevel = 16,
                    getTotalPoints   = TalentsHolderMgr.TotalKnightPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eKnightInnerStrengthEnhanced),
                    info             = FindStatsInfo(EPlayerSpells.eKnightInnerStrengthEnhanced),
                }
            },

            {
                EPlayerSpells.eKnightSoulLink,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPenalties,
                    nActivationLevel = 16,
                    getTotalPoints   = TalentsHolderMgr.TotalKnightPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eKnightSoulLink),
                    info             = FindStatsInfo(EPlayerSpells.eKnightSoulLink),
                }
            },

            {
                EPlayerSpells.eKnightCutTies,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eNone,
                    nActivationLevel = 20,
                    getTotalPoints   = TalentsHolderMgr.TotalKnightPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eKnightCutTies),
                    info             = FindStatsInfo(EPlayerSpells.eKnightCutTies),
                }
            },

            {
                EPlayerSpells.eKnightMastery,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eNone,
                    nActivationLevel = 20,
                    getTotalPoints   = TalentsHolderMgr.TotalKnightPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eKnightMastery),
                    info             = FindStatsInfo(EPlayerSpells.eKnightMastery),
                }
            },

            {
                EPlayerSpells.eKnightRebirth,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPercentage,
                    nActivationLevel = 20,
                    getTotalPoints   = TalentsHolderMgr.TotalKnightPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eKnightRebirth),
                    info             = FindStatsInfo(EPlayerSpells.eKnightRebirth),
                }
            },
            {
                EPlayerSpells.eBishopPushUp,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPenalties,
                    nActivationLevel = 0,
                    getTotalPoints   = TalentsHolderMgr.TotalBishopPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eBishopPushUp),
                    info             = FindStatsInfo(EPlayerSpells.eBishopPushUp),
                }
            },

            {
                EPlayerSpells.eBishopPushDown,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPenalties,
                    nActivationLevel = 0,
                    getTotalPoints   = TalentsHolderMgr.TotalBishopPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eBishopPushDown),
                    info             = FindStatsInfo(EPlayerSpells.eBishopPushDown),
                }
            },

            {
                EPlayerSpells.eBishopPushLeft,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPenalties,
                    nActivationLevel = 4,
                    getTotalPoints   = TalentsHolderMgr.TotalBishopPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eBishopPushLeft),
                    info             = FindStatsInfo(EPlayerSpells.eBishopPushLeft),
                }
            },

            {
                EPlayerSpells.eBishopPushRight,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPenalties,
                    nActivationLevel = 4,
                    getTotalPoints   = TalentsHolderMgr.TotalKnightPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eBishopPushRight),
                    info             = FindStatsInfo(EPlayerSpells.eBishopPushRight),
                }
            },

            {
                EPlayerSpells.eBishopThornTrap,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPenalties,
                    nActivationLevel = 0,
                    getTotalPoints   = TalentsHolderMgr.TotalBishopPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eBishopThornTrap),
                    info             = FindStatsInfo(EPlayerSpells.eBishopThornTrap),
                }
            },

            {
                EPlayerSpells.eBishopClearTrap,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPenalties,
                    nActivationLevel = 4,
                    getTotalPoints   = TalentsHolderMgr.TotalBishopPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eBishopClearTrap),
                    info             = FindStatsInfo(EPlayerSpells.eBishopClearTrap),
                }
            },

            {
                EPlayerSpells.eBishopWithholdEnemy,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPenalties,
                    nActivationLevel = 8,
                    getTotalPoints   = TalentsHolderMgr.TotalBishopPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eBishopWithholdEnemy),
                    info             = FindStatsInfo(EPlayerSpells.eBishopWithholdEnemy),
                }
            },

            {
                EPlayerSpells.eBishopEntangle,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPenalties,
                    nActivationLevel = 12,
                    getTotalPoints   = TalentsHolderMgr.TotalBishopPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eBishopEntangle),
                    info             = FindStatsInfo(EPlayerSpells.eBishopEntangle),
                }
            },

            {
                EPlayerSpells.eBishopFreeze,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPercentage,
                    nActivationLevel = 16,
                    getTotalPoints   = TalentsHolderMgr.TotalBishopPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eBishopFreeze),
                    info             = FindStatsInfo(EPlayerSpells.eBishopFreeze),
                }
            },

            {
                EPlayerSpells.eBishopInstantDeath,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eShowPenalties,
                    nActivationLevel = 16,
                    getTotalPoints   = TalentsHolderMgr.TotalBishopPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eBishopInstantDeath),
                    info             = FindStatsInfo(EPlayerSpells.eBishopInstantDeath),
                }
            },

            {
                EPlayerSpells.eBishopMastery,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eNone,
                    nActivationLevel = 20,
                    getTotalPoints   = TalentsHolderMgr.TotalBishopPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eBishopMastery),
                    info             = FindStatsInfo(EPlayerSpells.eBishopMastery),
                }
            },

            {
                EPlayerSpells.eBishopCutTies,
                new TalentsPanelButton
                {
                    eShowPenalties   = TalentsPanelButton.EShowPenaltiesType.eNone,
                    nActivationLevel = 20,
                    getTotalPoints   = TalentsHolderMgr.TotalBishopPoints,
                    talent           = TalentsHolderMgr.GetTalent(EPlayerSpells.eBishopCutTies),
                    info             = FindStatsInfo(EPlayerSpells.eBishopCutTies),
                }
            },
        };
    }
Example #6
0
 private void Start()
 {
     trapTalent = TalentsHolderMgr.GetTalent(EPlayerSpells.eBishopThornTrap);
 }
Example #7
0
File: Items.cs Project: skarow/ChD
 public override void Deequip()
 {
     TalentsHolderMgr.DowngradeSpell(EPlayerSpells.eKnightMoveLeft, 1);
 }
Example #8
0
File: Items.cs Project: skarow/ChD
 public override void Equip()
 {
     TalentsHolderMgr.UpgradeSpell(EPlayerSpells.eKnightSoulLink, 1);
 }
Example #9
0
File: Items.cs Project: skarow/ChD
 public override void Deequip()
 {
     TalentsHolderMgr.DowngradeSpell(EPlayerSpells.eKnightInnerStrength, 1);
 }
Example #10
0
File: Items.cs Project: skarow/ChD
 public override void Equip()
 {
     TalentsHolderMgr.UpgradeSpell(EPlayerSpells.eKnightMoveDown, 1);
 }
Example #11
0
 public void Activate()
 {
     PlayerTurnMgr.Instance.ChangeCurrentActivePlayer();
     TalentsHolderMgr.SetZeroPenalty();
 }