all repos — RPG @ master

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

Assets/Scripts/Battle/Abilities/Defend.cs (view raw)

 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4
 5[System.Serializable]
 6public class Defend : Ability
 7{
 8
 9    //constructor
10    public Defend()
11    {
12        guiName = "Defend";
13        hasTarget = false;
14        ow_usable = false;
15        MP_cost = 0;
16    }
17
18    public override string Execute(Fighter source, Fighter target, out bool output)
19    {
20        source.defending = true;
21        source.stats.DEF *= 2;
22
23        output = true;
24        return source + " is defending!";
25    }
26
27    public override string GetDescription()
28    {
29        return "Double your defence for one turn.";
30    }
31}