Пример #1
0
        //Basic Goblin, only attacks

        public static List <IEffect> getCommand(FullCombatCharacter source, List <FullCombatCharacter> targets, CombatData combatData)
        {
            List <IEffect>      effects = new List <IEffect>();
            FullCombatCharacter target  = BasicAbilityProcessing.identifyWeakestTarget(targets);
            int dmg = (int)((source.strength * 5 / target.vitality));

            target.inflictDamage(ref dmg);
            effects.Add(new Effect(EffectTypes.DealDamage, target.combatUniq, string.Empty, dmg));
            effects.Add(new Effect(EffectTypes.Message, 0, source.name + " has attacked " + target.name + " for " + dmg.ToString() + " damage!", 0));
            GeneralProcessor.calculateNextAttackTime(source, 1.0f);

            return(effects);
        }
Пример #2
0
        public static List <IEffect> getCommand(FullCombatCharacter source, List <FullCombatCharacter> targets, CombatData combatData)
        {
            List <IEffect>      effects     = new List <IEffect>();
            float               coefficient = 1.0f;
            FullCombatCharacter target      = BasicAbilityProcessing.identifyWeakestTarget(targets);
            int dmg = (int)((CombatCalculator.getNormalAttackValue(source) * 5 / target.vitality));

            if (target.inflictDamage(ref dmg) == FullCombatCharacter.HitEffect.Unbalance)
            {
                coefficient = coefficient * 2;
            }
            effects.Add(new Effect(EffectTypes.Attack, source.combatUniq, string.Empty, 0));
            effects.Add(new Effect(EffectTypes.DealDamage, target.combatUniq, string.Empty, dmg));
            effects.Add(new Effect(EffectTypes.Message, 0, source.name + " has attacked " + target.name + " for " + dmg.ToString() + " damage!", 0));
            GeneralProcessor.calculateNextAttackTime(source, coefficient, combatData);

            return(effects);
        }
Пример #3
0
        private void calculateTurn(bool killPreviousTurn)
        {
            //This is where all the stuff is calculated until the player's next move
            if (killPreviousTurn)
            {
                currentEffects.Clear();
            }

            if (BasicModificationsGeneration.hasMod(currentCharacter, "Arcane Prison"))
            {
                currentCharacter.nextAttackTime += 50;
                currentEffects.Add(new Effect(EffectTypes.Message, 0, currentCharacter.name + " is unable to move!", 0));
                combatData.setFirstTurnOver(currentCharacter.name);
                BasicModificationsGeneration.endTurnForUser(getAllPcsAsList(), currentCharacter.name);
                BasicModificationsGeneration.endTurnForUser(getAllNpcsAsList(), currentCharacter.name);
                currentEffects.Add(new Effect(EffectTypes.TurnEnded, 0, string.Empty, 0));
            }
            else
            {
                if (currentCharacterIsPC)
                {
                    currentEffects.Add(new Effect(EffectTypes.ShowCommand, 0, string.Empty, 0));
                }
                else
                {
                    List <IEffect> enemyEffects = BasicAbilityProcessing.getCommand(currentCharacter, getAllPcsAsList(), combatData);
                    combatData.setFirstTurnOver(currentCharacter.name);
                    BasicModificationsGeneration.endTurnForUser(getAllPcsAsList(), currentCharacter.name);
                    BasicModificationsGeneration.endTurnForUser(getAllNpcsAsList(), currentCharacter.name);
                    foreach (IEffect e in enemyEffects)
                    {
                        currentEffects.Add(e);
                    }
                    currentEffects.Add(new Effect(EffectTypes.TurnEnded, 0, string.Empty, 0));
                }
            }

            //Update Combat Data Models
            updateDataModels();
        }