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();
            }
        }
Пример #2
0
 public ManagedVerb(Verb verb, VerbSource source, AdditionalVerbProps props, VerbManager man)
 {
     Verb     = verb;
     Source   = source;
     Props    = props;
     this.man = man;
 }
Пример #3
0
 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);
 }
Пример #4
0
 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);
 }
Пример #5
0
 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);
 }
Пример #6
0
 public TurretVerb(Verb verb, VerbSource source, AdditionalVerbProps props, VerbManager man) : base(verb, source,
                                                                                                    props, man)
 {
     verb.castCompleteCallback = () => cooldownTicksLeft = Verb.verbProps.AdjustedCooldownTicks(Verb, man.Pawn);
 }