Added a levelup command
This commit is contained in:
committed by
Christopher Grant
parent
98fd875a43
commit
66c33452e8
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user