public ManagedVerb(Verb verb, VerbSource source, AdditionalVerbProps props, VerbManager man) { Verb = verb; Source = source; Props = props; this.man = man; if (Props != null && Props.draw && !Base.Features.Drawing) { Log.Error( "[MVCF] Found a verb marked to draw while that feature is not enabled. Enabling now. This is not recommend."); Base.Features.Drawing = true; Base.ApplyPatches(); } if (Props != null && Props.canFireIndependently && !Base.Features.IndependentFire) { Log.Error( "[MVCF] Found a verb marked to fire independently while that feature is not enabled. Enabling now. This is not recommend."); Base.Features.IndependentFire = true; Base.ApplyPatches(); } if (Props != null && !Props.separateToggle && !Base.Features.IntegratedToggle) { Log.Error( "[MVCF] Found a verb marked for an integrated toggle while that feature is not enabled. Enabling now. This is not recommend."); Base.Features.IntegratedToggle = true; Base.ApplyPatches(); } }
public ManagedVerb(Verb verb, VerbSource source, AdditionalVerbProps props, VerbManager man) { Verb = verb; Source = source; Props = props; this.man = man; }
public TurretVerb(Verb verb, VerbSource source, AdditionalVerbProps props, VerbManager man) : base(verb, source, props, man) { dummyCaster = new DummyCaster(man.Pawn, this); dummyCaster.Tick(); dummyCaster.SpawnSetup(man.Pawn.Map, false); verb.caster = dummyCaster; verb.castCompleteCallback = () => cooldownTicksLeft = Verb.verbProps.AdjustedCooldownTicks(Verb, man.Pawn); }
public VerbManager GetManagerFor(Pawn pawn, bool createIfMissing = true) { if (managers.TryGetValue(pawn, out var manager)) { return(manager); } if (!createIfMissing) { return(null); } manager = new VerbManager(); manager.Initialize(pawn); managers.Add(pawn, manager); return(manager); }
public VerbManager GetManagerFor(Pawn pawn, bool createIfMissing = true) { if (managers.TryGetValue(pawn, out var manager)) { return(manager); } if (!createIfMissing) { return(null); } manager = new VerbManager(); manager.Initialize(pawn); if (currentVerbSaved != null && currentVerbSaved.TryGetValue(pawn, out var currentVerb)) { manager.CurrentVerb = currentVerb; } managers.Add(pawn, manager); allManagers.Add(new System.WeakReference <VerbManager>(manager)); return(manager); }
public TurretVerb(Verb verb, VerbSource source, AdditionalVerbProps props, VerbManager man) : base(verb, source, props, man) { verb.castCompleteCallback = () => cooldownTicksLeft = Verb.verbProps.AdjustedCooldownTicks(Verb, man.Pawn); }