all repos — RPG @ e473e7dcfb2acd82870d5f2ccbbd3d9539e07c45

Fully functional 3D turn based role playing game coded in C# and base Unity.

Assets/Scripts/Battle/Fighters/Orc.cs (view raw)

 1using System.Collections.Generic;
 2using UnityEngine;
 3
 4public class Orc : BadGuy
 5{
 6    public Orc() {
 7        stats = new Stats("Orc");
 8        description = "Dumb and weak, the most pathetic enemy you can think of.";
 9
10        goldDrop = 43;
11        itemsDrop = new Inventory();
12        itemsDrop.generateItem(new ItemInfo(new Potion(), 1));
13        //itemsDrop.generateItem(new ItemInfo(new Key(), 1));
14        
15        dead = defending = false;
16    }
17
18    public override string Combat_AI()
19    {
20        //attack a random goodGuy
21        Fighter[] temp = GameObject.Find("BattleManager").GetComponent<BattleManager>().getGuys(false);
22        bool output;
23        do
24        {
25            return AbilityDB.Process(this, new Attack(), temp[Random.Range(0, temp.Length)], true, out output);
26        } while (output == false);
27    }
28}
29
30//2.16 0 22.9
31//0 180 0