Esempio n. 1
0
 public ObstacleEntity(Combat.Alignment alignment, bool actor, int maxHealth,
                       string name = "Obstacle", Visual.CharacterAppearanceData appearance = null, ElementalAffinity affinity = null, Date?birth = null, int?health = null)
 {
     this.alignment = alignment;
     this.actor     = actor;
     this.maxHealth = maxHealth;
     this.name      = name;
     // optional parameters
     if (appearance != null)
     {
         this.appearance = appearance;
     }
     else
     {
         this.appearance = Visual.CharacterAppearanceData.Random();
     }
     if (affinity != null)
     {
         this.affinity = affinity;
     }
     else
     {
         this.affinity = ElementalAffinity.RandomAffinity();
     }
     if (health.HasValue)
     {
         this.health = health.Value;
     }
     else
     {
         this.health = maxHealth;
     }
     //TODO: SkillHandler.FillSkills(this);
 }
Esempio n. 2
0
 public ClassicBattleGeneration(MapType map, EnemyType enemyType, int count, ElementalAffinity elements, string enemyNoun = null)
 {
     this.map        = map;
     this.enemyType  = enemyType;
     this.enemyNoun  = enemyNoun;
     this.enemyCount = count;
     this.elements   = elements;
 }
Esempio n. 3
0
 public bool TakeDamage(int damageValue, ElementalAffinity elementalAffinity)
 {
     if (elementalAffinities.ContainsKey(elementalAffinity.targetElement.ToString()))
     {
         float affinity = ((float)((ElementalAffinity)elementalAffinities[elementalAffinity.targetElement.ToString()]).value / 256f) - ((float)elementalAffinity.value / 256f);
         damageValue = (int)(damageValue * affinity);
     }
     return(AdjustHealth(-damageValue));
 }
Esempio n. 4
0
 private MockCraft()
 {
     itemLevel = 0;
     baseItemLevel = 0;
     durability = 0;
     remainingDurability = 0;
     progress = 0;
     difficulty = 0;
     quality = 0;
     itemQuality = 0;
     itemName = String.Empty;
     step = 0;
     affinity = ElementalAffinity.None;
 }
Esempio n. 5
0
        protected int CalculateDamage(GameObject unit)
        {
            Character target = unit.GetComponent <Character>();

            // Calculate the current units rune bonuses
            CalculateRuneStats();
            int damage = Mathf.RoundToInt(
                // Standard atk-def calc
                (Mathf.Pow(currentAtk, 2) + totalRuneAtk) / (target.GetCurrentDef() + target.GetRuneDef())
                // Level compensation
                * (1 + (currentLevel * 2 - target.currentLevel) / 50)
                // Elemental multiplier
                * ElementalAffinity.CalcElementalDamage(attackElement, target.element));

            return(damage);
        }
Esempio n. 6
0
    public void AddAffinity(ElementalAffinity e)
    {
        if (currentUpgradePoints > 0)
        {
            attributes.Upgrade(e);
            currentUpgradePoints--;

            foreach (WeaponUpgrade wUp in upgradeReq)
            {
                if (wUp.CheckRequirements(attributes))
                {
                    isReadyForUpgrade = true;
                }
            }
        }
    }
Esempio n. 7
0
        protected int CalculateMultiHitDamage(int attackValue, GameObject unit)
        {
            Character target = unit.GetComponent <Character>();

//		Debug.Log(string.Format("{0}'s atk: {1}, {2}'s def: {3}",
//			source.name, source.GetCurrentAtk(), target.name, target.GetCurrentDef()));
//		Debug.Log(string.Format("{0}'s attack element: {1}, {2} element: {3}",
//			source.name, source.GetAttackElement(), target.name, target.element));
            // Calculate the current units rune bonuses
            CalculateRuneStats();
            int damage = Mathf.RoundToInt(
                // Standard atk-def calc
                Mathf.Pow(attackValue, 2) / (target.GetCurrentDef() + target.GetRuneDef())
                // Level compensation
                * (1 + (currentLevel * 2 - target.currentLevel) / 50)
                // Elemental multiplier
                * ElementalAffinity.CalcElementalDamage(attackElement, target.element));

            return(damage);
        }
Esempio n. 8
0
 public void Init(ElementalAffinity ea)
 {
     myEA = ea;
     UpdateGraphics();
 }
Esempio n. 9
0
 public void SetInitialValues(int recipeLevel, int itemLevel, int durability, int difficulty, int itemQuality, string itemName, ElementalAffinity affinity)
 {
     this.recipeLevel = recipeLevel;
     this.itemLevel = itemLevel;
     this.baseItemLevel = itemLevel;
     this.durability = durability;
     this.remainingDurability = durability;
     this.difficulty = difficulty;
     this.itemQuality = itemQuality;
     this.itemName = itemName;
     this.affinity = affinity;
 }
Esempio n. 10
0
 public void Upgrade(ElementalAffinity e)
 {
     (elementalAffinities [e.targetElement.ToString()] as ElementalAffinity).value += e.value;
 }
Esempio n. 11
0
 public void SetAffinity(ElementalAffinity affinity)
 {
     CheckSetup();
     resistance.SetElements(affinity.GetResistances());
     weakness.SetElements(affinity.GetWeaknesses());
 }