Added a levelup command

This commit is contained in:
Christopher Grant
2014-08-17 23:00:02 -04:00
committed by Christopher Grant
parent 98fd875a43
commit 66c33452e8
2 changed files with 40 additions and 5 deletions

View File

@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Traits
}
}
public class GainsExperience : ISync
public class GainsExperience : ISync, IResolveOrder
{
readonly Actor self;
readonly GainsExperienceInfo info;
@@ -119,6 +119,20 @@ namespace OpenRA.Mods.Common.Traits
}
}
}
public void ResolveOrder(Actor self, Order order)
{
if (!self.World.AllowDevCommands)
return;
if (order.OrderString == "DevLevelUp")
{
if ((int)order.ExtraData > 0)
GiveLevels((int)order.ExtraData);
else
GiveLevels(1);
}
}
}
class ExperienceInit : IActorInit<int>