예제 #1
0
        public static KeyValuePair <List <int>, List <int> > CalculateDamage(BaseCharacter g, BaseCharacter r, BasicAbility gca, BasicAbility rca)
        {
            BasicAbility Idle = new BasicAbility();

            Idle.abilityName = "Idle";


            castAbility = gca;
            giver       = g;
            receiver    = r;


            giverAS    = g.trueSTATChart();
            giverAS    = giverAS.StatChartAddition(gca.abilityModifier);
            receiverAS = r.trueSTATChart();

            List <int> giverDMG  = new List <int>();
            List <int> targetDMG = new List <int>();

            if (gca.abilityType == (int)BasicAbility.ABILITY_TYPE.ATTACK)
            {
                giverDMG.Add(CalculateMinDamage());
                giverDMG.Add(CalculateMaxDamage());
                targetDMG.Add(0);
                targetDMG.Add(0);
            }

            return(new KeyValuePair <List <int>, List <int> >(giverDMG, targetDMG));
        }
예제 #2
0
        internal static KeyValuePair <List <int>, List <int> > CalculateHealing(BaseCharacter g, BaseCharacter r, BasicAbility gca, BasicAbility rca)
        {
            BasicAbility Idle = new BasicAbility();

            Idle.abilityName = "Idle";


            castAbility = gca;
            giver       = g;
            receiver    = r;


            giverAS    = g.trueSTATChart();
            giverAS    = giverAS.StatChartAddition(gca.abilityModifier);
            receiverAS = r.trueSTATChart();

            List <int> giverDMG  = new List <int>();
            List <int> targetDMG = new List <int>();

            if (gca.abilityType == (int)BasicAbility.ABILITY_TYPE.SUPPORT)
            {
                giverDMG.Add(-(g.trueSTATChart().currentActiveStats[(int)STATChart.ACTIVESTATS.HP]));
                giverDMG.Add(-(g.trueSTATChart().currentActiveStats[(int)STATChart.ACTIVESTATS.HP] + g.trueSTATChart().currentActiveStats[(int)STATChart.ACTIVESTATS.HP] / 2));
                targetDMG.Add(0);
                targetDMG.Add(0);
            }

            return(new KeyValuePair <List <int>, List <int> >(giverDMG, targetDMG));
        }
예제 #3
0
        public static void InitiateCombat(BaseCharacter g, BaseCharacter r, BasicAbility gca, BasicAbility rca)
        {
            bMods.Clear();
            foreach (var item in Enum.GetNames(typeof(BattleMods)))
            {
                bMods.Add(0);
            }
            castAbility = gca;
            giver       = g;
            receiver    = r;
            // giverAS.DefaultStatChart();
            // receiverAS.DefaultStatChart();

            giverAS    = g.trueSTATChart();
            receiverAS = r.trueSTATChart();
            Console.WriteLine(g.trueSTATChart().currentActiveStats[(int)STATChart.ACTIVESTATS.SHIELD]);

            if (gca.abilityType == (int)BasicAbility.ABILITY_TYPE.ATTACK)
            {
                bMods[(int)BattleMods.MIN_DAMAGE]        = CalculateMinDamage();
                bMods[(int)BattleMods.MAX_DAMAGE]        = CalculateMaxDamage();
                bMods[(int)BattleMods.MIN_STATUS_CHANCE] = 0;
                bMods[(int)BattleMods.MAX_STATUS_CHANCE] = 0;
                bMods[(int)BattleMods.CRIT]  = 5;
                bMods[(int)BattleMods.DODGE] = 5;
                bMods[(int)BattleMods.FAIL]  = 5;
            }

            BattleGUI.Start(giverAS, receiverAS, g, r, gca, rca);
        }
        public String GetEstimatedPotency(BaseCharacter bc)
        {
            String potencyText = "";
            int    levelCheck  = bc.CCC.equippedClass.classEXP.classLevel + 2;

            if (levelCheck < 0)
            {
                levelCheck = 0;
            }
            BaseCharacter temp   = new BaseCharacter();
            STATChart     tempSC = new STATChart(true);

            for (int i = 0; i < tempSC.currentActiveStats.Count; i++)
            {
                tempSC.currentActiveStats[i] = levelCheck;
            }
            for (int i = 0; i < tempSC.currentPassiveStats.Count; i++)
            {
                tempSC.currentPassiveStats[i] = levelCheck;
            }
            for (int i = 0; i < tempSC.currentSpecialStats.Count; i++)
            {
                tempSC.currentSpecialStats[i] = levelCheck;
            }
            temp.statChart = tempSC;
            var lai = LUA.LuaAbilityInfo.abiToLuaAbilityInfo(this, bc.toCharInfo(), temp.toCharInfo());

            lai.ExecuteScript();

            potencyText = lai.minDmg + " - " + lai.maxDmg;

            return(potencyText);
        }
        internal STATChart Clone()
        {
            STATChart sc = new STATChart();

            sc.currentActiveStats  = new List <int>(currentActiveStats);
            sc.currentPassiveStats = new List <int>(currentPassiveStats);
            sc.currentSpecialStats = new List <int>(currentSpecialStats);
            return(sc);
        }
        public ClassExperience(BaseClass c)
        {
            baseClass   = c;
            exp         = c.classEXP.totalExp;
            level       = c.classEXP.classLevel;
            classID     = c.classIdentifier;
            stats       = c.classStats;
            bIsUnlocked = c.bIsUnlocked;

            classPoints = ClassPoints.Copy(c);
        }
 public bool IsAbilityAvailable(STATChart ts)
 {
     if (abilityCooldownTimer == 0 && ts.currentActiveStats[(int)STATChart.ACTIVESTATS.MANA] >= currentMPCost() && ts.currentActiveStats[(int)STATChart.ACTIVESTATS.STORED_AP] >= currentAPCost())
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
        internal void AddStatChartWithoutActive(STATChart sc)
        {
            for (int i = 0; i < currentPassiveStats.Count; i++)
            {
                currentPassiveStats[i] += sc.currentPassiveStats[i];
            }

            for (int i = 0; i < currentSpecialStats.Count; i++)
            {
                currentSpecialStats[i] += sc.currentSpecialStats[i];
            }
        }
        public static ActiveStatModifier Generate(STATChart sc)
        {
            ActiveStatModifier temp = new ActiveStatModifier();

            temp.activeStatModifier = new List <int>(sc.currentActiveStats);
            foreach (var item in temp.activeStatModifier)
            {
                if (item != 0)
                {
                    return(temp);
                }
            }
            return(null);
        }
예제 #10
0
        public TBAGW.STATChart ExtractStatChart(LuaStatEdit lse)
        {
            TBAGW.STATChart temp = new TBAGW.STATChart(true);

            foreach (var item in lse.modifyStats)
            {
                TryExtractActiveStats(ref temp, item);
                TryExtractPassiveStats(ref temp, item);
                TryExtractSpecialStats(ref temp, item);
            }

            // ActivePassiveStatsEqual(ref temp);

            return(temp);
        }
예제 #11
0
 public EnemyAIInfo(BaseCharacter bc, MapRegion r)
 {
     EnemyChar        = bc.Clone();
     charID           = bc.shapeID;
     EnemyWeapon      = bc.weapon == null ? null : bc.weapon.Clone() as BaseEquipment;
     charWeaponID     = bc.weaponID;
     charArmorID      = bc.armourID;
     EnemyArmor       = bc.armour == null ? null : bc.armour.Clone() as BaseEquipment;
     enemyStats       = bc.statChart.Clone();
     CCCidentifier    = bc.CCCidentifier;
     CCC              = bc.CCC.Clone();
     enemyWeaponArray = new List <int>(bc.enemyWeaponArray);
     enemyArmourArray = new List <int>(bc.enemyArmourArray);
     enemyName        = bc.displayName;
     infoID           = r.highestEnemyID++;
 }
        public STATChart StatChartAddition(STATChart sc)
        {
            STATChart newSC = new STATChart();

            newSC.DefaultStatChart();


            foreach (int statIndex in Enum.GetValues(typeof(PASSIVESTATS)))
            {
                try
                {
                    newSC.currentPassiveStats[statIndex] = currentPassiveStats[statIndex] + sc.currentPassiveStats[statIndex];
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }


            foreach (int statIndex in Enum.GetValues(typeof(ACTIVESTATS)))
            {
                try
                {
                    newSC.currentActiveStats[statIndex] = currentActiveStats[statIndex] + sc.currentActiveStats[statIndex];
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }

            foreach (int statIndex in Enum.GetValues(typeof(SPECIALSTATS)))
            {
                try
                {
                    newSC.currentSpecialStats[statIndex] = currentSpecialStats[statIndex] + sc.currentSpecialStats[statIndex];
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    currentSpecialStats.Add(0);
                }
            }

            return(newSC);
        }
        public STATChart AddActiveStatChart(STATChart sc)
        {
            STATChart newSC = new STATChart();

            newSC.DefaultStatChart();

            foreach (int statIndex in Enum.GetValues(typeof(ACTIVESTATS)))
            {
                try
                {
                    newSC.currentActiveStats[statIndex] = currentActiveStats[statIndex] + sc.currentActiveStats[statIndex];
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }

            return(newSC);
        }
        internal void GenerateStatUp()
        {
            if (bMustGenerateStatUp)
            {
                statUp = new STATChart(true);

                for (int i = 0; i < classStats.currentActiveStats.Count; i++)
                {
                    if (classStats.currentPassiveStats[i] != 0)
                    {
                        statUp.currentPassiveStats[i] = classStats.currentPassiveStats[i];
                        if (statUp.currentPassiveStats[i] > classEXP.classLevel + 1)
                        {
                            statUp.currentPassiveStats[i] = classEXP.classLevel + 1;
                        }
                    }
                }

                bMustGenerateStatUp = false;
            }
        }
        public void ProcessStats(STATChart sc, STATChart trueSC)
        {
            int maxTrueHP = trueSC.currentPassiveStats[(int)STATChart.PASSIVESTATS.MAXHP];
            int maxTrueMP = trueSC.currentPassiveStats[(int)STATChart.PASSIVESTATS.MAXMANA];

            int currentTrueHP = trueSC.currentActiveStats[(int)STATChart.ACTIVESTATS.HP];
            int currentTrueMP = trueSC.currentActiveStats[(int)STATChart.ACTIVESTATS.MANA];

            if (currentTrueHP <= maxTrueHP)
            {
                if (currentTrueHP + activeStatModifier[(int)STATChart.ACTIVESTATS.HP] < maxTrueHP)
                {
                    sc.currentActiveStats[(int)STATChart.ACTIVESTATS.HP] += activeStatModifier[(int)STATChart.ACTIVESTATS.HP];
                }
                else
                {
                    sc.currentActiveStats[(int)STATChart.ACTIVESTATS.HP] = maxTrueHP;
                }
            }

            if (currentTrueMP <= maxTrueMP)
            {
                if (currentTrueMP + activeStatModifier[(int)STATChart.ACTIVESTATS.MANA] < maxTrueMP)
                {
                    sc.currentActiveStats[(int)STATChart.ACTIVESTATS.MANA] += activeStatModifier[(int)STATChart.ACTIVESTATS.MANA];
                }
                else
                {
                    sc.currentActiveStats[(int)STATChart.ACTIVESTATS.MANA] = maxTrueMP;
                }
            }

            sc.currentActiveStats[(int)STATChart.ACTIVESTATS.SHIELD] += activeStatModifier[(int)STATChart.ACTIVESTATS.SHIELD];

            sc.currentActiveStats[(int)STATChart.ACTIVESTATS.STORED_AP] += activeStatModifier[(int)STATChart.ACTIVESTATS.STORED_AP];
        }
        internal bool RequirementCheckFromChar(STATChart sc, bool bReverse = false)
        {
            for (int i = 0; i < sc.currentActiveStats.Count; i++)
            {
                if (i > 0)
                {
                    if (!bReverse)
                    {
                        if (currentActiveStats[i] < sc.currentActiveStats[i])
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        if (currentActiveStats[i] > sc.currentActiveStats[i])
                        {
                            return(false);
                        }
                    }
                }
            }

            for (int i = 0; i < sc.currentPassiveStats.Count; i++)
            {
                if (i > 0)
                {
                    if (!bReverse)
                    {
                        if (currentPassiveStats[i] < sc.currentPassiveStats[i])
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        if (currentPassiveStats[i] > sc.currentPassiveStats[i])
                        {
                            return(false);
                        }
                    }
                }
            }


            for (int i = 0; i < sc.currentSpecialStats.Count; i++)
            {
                if (i > 0)
                {
                    if (!bReverse)
                    {
                        if (currentSpecialStats[i] < sc.currentSpecialStats[i])
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        if (currentSpecialStats[i] > sc.currentSpecialStats[i])
                        {
                            return(false);
                        }
                    }
                }
            }

            return(true);
        }