transformation can pass exp to new actor
This commit is contained in:
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
public object Create(ActorInitializer init) { return new GainsExperience(init, this); }
|
public object Create(ActorInitializer init) { return new GainsExperience(init, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GainsExperience : INotifyCreated, ISync, IResolveOrder
|
public class GainsExperience : INotifyCreated, ISync, IResolveOrder, ITransformActorInitModifier
|
||||||
{
|
{
|
||||||
readonly Actor self;
|
readonly Actor self;
|
||||||
readonly GainsExperienceInfo info;
|
readonly GainsExperienceInfo info;
|
||||||
@@ -143,6 +143,11 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
GiveLevels(1);
|
GiveLevels(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ITransformActorInitModifier.ModifyTransformActorInit(Actor self, TypeDictionary init)
|
||||||
|
{
|
||||||
|
init.Add(new ExperienceInit(experience));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExperienceInit : IActorInit<int>
|
class ExperienceInit : IActorInit<int>
|
||||||
|
|||||||
Reference in New Issue
Block a user