public void affectCreature(CreatureClass cc) { switch (effectType) { case 1: //Damage spell X cc.takeDamage(e_value); Debug.Log("(Spell)Damage on creature: " + cc.name); break; case 2: //Heal spell X cc.takeHealing(e_value); Debug.Log("(Spell)Heal on creature: " + cc.name); break; case 3: //Drain arcana X cc.spendArcana(e_value); Debug.Log("(Spell)Arcana drained on creature: " + cc.name); break; case 4: //Full arcana MAX cc.setArcana(cc.getMaxArcana()); Debug.Log("(Spell)Arcana maxed for creature: " + cc.name); break; case 5: //Buff defense +1 cc.setDefense(cc.getDefense() + 1f); Debug.Log("(Spell)Defense buffed for creature: " + cc.name); break; default: Debug.Log("spell effect hit default"); break; } }
public LivingCreature(int currentHitPoints, int maxHitPoints, CreatureType type, CreatureClass difficulty) { CurrentHitPoints = currentHitPoints; MaximumHitPoints = maxHitPoints; Type = type; Difficulty = difficulty; }
public void AttackCreatureRanged(CreatureClass creature) { if (creature.getName() == this.getName()) { Debug.Log("Can't attack yourself!"); return; } Debug.Log("attacking ranged"); //IMPLEMENT return; }
Spell retrieveCreatureSpellFromList(string name, CreatureClass cc) { foreach (Spell spell in cc.getSpells()) { //Debug.Log("list contains: " + spell.getSpellName()); if (spell.getSpellName() == name) { return(spell); } } Debug.Log("No such spell in creature"); return(null); }
public int GetCreatureWeaponType(int view) { if (view == 0) { CreatureClass cc = currentCreatureSelected.GetComponent <CreatureClass>(); return(cc.getMainHandType()); } else { CreatureClass cc = getCreatureHover(); return(cc.getMainHandType()); } }
public Monster(int id, string name, string namePlural, int maxDamage, int rewardExp, int reward, int currentHitPoints, int maxHitPoints, CreatureType type, CreatureClass difficulty, int lootID, int magic) : base(currentHitPoints, maxHitPoints, type, difficulty) { ID = id; Name = name; NamePlural = namePlural; MaximumDamage = maxDamage; RewardExperiencePoints = rewardExp; RewardGold = reward; CurrentHitPoints = currentHitPoints; MaximumHitPoints = maxHitPoints; Type = type; Difficulty = difficulty; LootID = lootID; Magic = magic; }
public Player(int str, int dex, int inte, int chari, int gold, string name, int exp, int level, QuestOption questOp, int currentHitPoints, int maxHitPoints, CreatureType type, CreatureClass difficulty) : base(currentHitPoints, maxHitPoints, type, difficulty) { Strength = str; Dexterity = dex; Intelligence = inte; Charisma = chari; Gold = gold; Name = name; ExperiecePoints = exp; Level = level; QuestOp = questOp; CurrentHitPoints = currentHitPoints; MaximumHitPoints = maxHitPoints; Type = type; Difficulty = difficulty; Inventory = new List <InventoryItem>(); }
public void AttackCreatureMelee(CreatureClass creature) { if (creature.getName() == this.getName()) { Debug.Log("Can't attack yourself!"); return; } float rnd = Random.Range(0, 100); float chance = rnd + critChance; int modifier = 1; int calcDamage = Mathf.FloorToInt((2 * Random.Range(this.getAtkPower(), this.getAtkPower() + 5) - creature.getDefense()) * 0.5f); if (chance >= 80) { modifier = modifier * 2; } creature.takeDamage(calcDamage * modifier); //Debug.Log("Attacked creature: " + creature + " with " + calcDamage*modifier + " damage " + "cc: " + chance); GameObject tmp_txt = Instantiate(damageText); tmp_txt.GetComponent <Text_Damage>().setPos(creature.transform.position); tmp_txt.GetComponent <Text_Damage>().setText("-" + (calcDamage * modifier).ToString()); }
public void UpdateUI(GameObject Creature, bool show) { if (Creature == null) { ShowUI(false); return; } if (show == false) { ShowUI(false); } else { ShowUI(true); } CreatureClass cCreature = Creature.GetComponent <CreatureClass>(); SetName(cCreature.getName()); SetHealth(cCreature.getHealth(), cCreature.getMaxHealth()); SetArcana(cCreature.getArcana(), cCreature.getMaxArcana()); SetExp(cCreature.getExp(), cCreature.getMaxExp()); SetSprite(cCreature.getSprite()); }
public void trigger(CreatureClass cc) { this.effect.affectCreature(cc); }
public void triggerEffect(CreatureClass cc) { getSpell().trigger(cc); }