Initial Commit
Initial commit of project.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package commands.rpg;
|
||||
|
||||
import core.rpg.RPGCommand;
|
||||
import core.rpg.RPGInput;
|
||||
import core.rpg.RPGState;
|
||||
|
||||
public class RPGCommandBattleRun extends RPGCommand
|
||||
{
|
||||
@Override
|
||||
public String OnRun(RPGState state, RPGInput input)
|
||||
{
|
||||
if(state.battleContext == null)
|
||||
return "```There's nothing to run from!```";
|
||||
|
||||
long lostGold = (long)(state.player.GetGold() * .1);
|
||||
String out = null;
|
||||
|
||||
state.player.SpendGold(lostGold);
|
||||
state.battleContext = null;
|
||||
|
||||
out = "You duck behind a tree and manage to escape from encounter just barely!";
|
||||
if(lostGold > 0)
|
||||
{
|
||||
out += " As you make your final move to escape, you accidentally drop some of your gold behind. You don't dare try to go back and pick it up.";
|
||||
out += "\n";
|
||||
out += "\n";
|
||||
out += "[-" + lostGold + "gp]";
|
||||
}
|
||||
|
||||
if(out != null)
|
||||
out = "```\n" + out + "```";
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user