Exemple #1
0
    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;
        }
    }
Exemple #2
0
 public LivingCreature(int currentHitPoints, int maxHitPoints,
                       CreatureType type, CreatureClass difficulty)
 {
     CurrentHitPoints = currentHitPoints;
     MaximumHitPoints = maxHitPoints;
     Type             = type;
     Difficulty       = difficulty;
 }
Exemple #3
0
 public void AttackCreatureRanged(CreatureClass creature)
 {
     if (creature.getName() == this.getName())
     {
         Debug.Log("Can't attack yourself!");
         return;
     }
     Debug.Log("attacking ranged");
     //IMPLEMENT
     return;
 }
Exemple #4
0
 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);
 }
Exemple #5
0
 public int GetCreatureWeaponType(int view)
 {
     if (view == 0)
     {
         CreatureClass cc = currentCreatureSelected.GetComponent <CreatureClass>();
         return(cc.getMainHandType());
     }
     else
     {
         CreatureClass cc = getCreatureHover();
         return(cc.getMainHandType());
     }
 }
Exemple #6
0
 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;
 }
Exemple #7
0
 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>();
 }
Exemple #8
0
    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());
    }
Exemple #9
0
    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());
    }
Exemple #10
0
 public void trigger(CreatureClass cc)
 {
     this.effect.affectCreature(cc);
 }
Exemple #11
0
 public void triggerEffect(CreatureClass cc)
 {
     getSpell().trigger(cc);
 }