Auto stash before merge of "develop" and "origin/develop"

This commit is contained in:
Alex
2019-05-13 15:52:28 -04:00
parent 03f6ffb3e8
commit d3c0258e60
3 changed files with 65 additions and 1 deletions
+8 -1
View File
@@ -228,4 +228,11 @@ MapVersion=Using mapgen v0.1
MapWidth=Width MapWidth=Width
MapHeight=Height MapHeight=Height
[CommandTradeBeans]
TradeBeansInfo=Gives another person some of your beans! Use is `tradebeans amount @person`!
TradeBeansNoTargetError=You have to give *someone* your beans!
TradeBeansIntParseError=That's not a real number!
TradeBeansNotEnoughError=You don't have enough beans!
TradeBeanseStealingBeans=Stealing is wrong! *Steals 10 beans from %s*
TradeBeansSuccess=%s gave %s %s of their beans!
+56
View File
@@ -0,0 +1,56 @@
package commands;
import core.Command;
import core.LocStrings;
import dataStructures.KittyChannel;
import dataStructures.KittyGuild;
import dataStructures.KittyRating;
import dataStructures.KittyRole;
import dataStructures.KittyUser;
import dataStructures.Response;
import dataStructures.UserInput;
public class CommandTradeBeans extends Command
{
public CommandTradeBeans(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String HelpText() { return LocStrings.Stub("TradeBeansInfo"); }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
if(input.mentions == null)
{
res.Call(LocStrings.Stub("TradeBeansNoTargetError"));
return;
}
int beans = 0;
try {
beans = Integer.parseInt(input.args.split(" ")[0]);
}
catch (NumberFormatException e)
{
res.Call(LocStrings.Stub("TradeBeansIntParseError"));
return;
}
if(user.GetBeans() < beans)
{
res.Call(LocStrings.Stub("TradeBeansNotEnoughError"));
return;
}
if(beans < 0)
{
res.Call(String.format(LocStrings.Stub("TradeBeansStealingBeans"), user.name));
user.ChangeBeans(-10);
return;
}
input.mentions[0].ChangeBeans(beans);
user.ChangeBeans(-beans);
res.Call(String.format(LocStrings.Stub("TradeBeansSuccess"), user.name, input.mentions[0].name, beans));
}
}
+1
View File
@@ -13,6 +13,7 @@ public class KittyEmbed
public String descriptionText = null; public String descriptionText = null;
public String bodyImageURL = null; public String bodyImageURL = null;
public String imageURL = null; public String imageURL = null;
public String bodyImageURL = null;
public KittyEmbed() public KittyEmbed()
{ {