public CoilgunMultikillTracker(CoilgunMultikillTracker other)
     : base(other)
 {
     this.minKills    = other.minKills;
     this.exceptShell = other.exceptShell;
     this.onlyShell   = other.onlyShell;
 }
        public override bool Trigger(int kills, float totalDamage, CoilgunShellDef shellDef)
        {
            if (shellDef == null)
            {
                return(false);
            }

            bool isOnly        = this.onlyShell == null || this.onlyShell == shellDef;
            bool isNotExcluded = this.exceptShell == null || this.exceptShell != shellDef;

            return(kills >= this.minKills && isOnly && isNotExcluded);
        }
Esempio n. 3
0
        public override bool Trigger(int kills, float totalDamage, CoilgunShellDef shellDef)
        {
            if (kills < minKills)
            {
                return(false);
            }
            if (totalDamage < minDamage)
            {
                return(false);
            }

            if (exceptShells == null || exceptShells.Count == 0 || shellDef == null)
            {
                return(true);
            }

            return(!exceptShells.Contains(shellDef));
        }
Esempio n. 4
0
        public override void ExposeData()
        {
            base.ExposeData();

            Scribe_Values.Look(ref FireTicks, "coil_fireTicks", -1);
            Scribe_Values.Look(ref CurrentState, "coil_state", State.Idle);
            Scribe_TargetInfo.Look(ref CurrentTargetInfo, "coil_target", LocalTargetInfo.Invalid);
            Scribe_Values.Look(ref LastKnowPos, "coil_lastKnownPos");
            Scribe_Values.Look(ref Recoil, "coil_recoil");
            Scribe_Values.Look(ref RecoilVel, "coil_recoilVel");
            Scribe_Values.Look(ref ticksSinceCapacitorRefresh, "coil_ticksSinceCapRefresh");
            Scribe_Collections.Look(ref rawCapacitors, "coil_rawCaps", LookMode.Reference);
            rawCapacitors ??= new List <Building_Capacitor>();

            Scribe_Defs.Look(ref shellDef, "coil_shellDef");

            if (Scribe.mode == LoadSaveMode.LoadingVars)
            {
                ReplaceFuelProps(GetComp <CompRefuelable>());
            }

            CurrentShellDef = shellDef;
        }
Esempio n. 5
0
 public override void PostMake()
 {
     base.PostMake();
     ReplaceFuelProps(FuelComp);
     CurrentShellDef = shellDef;
 }
Esempio n. 6
0
 public override bool Trigger(int depth, Pawn p, CoilgunShellDef s)
 {
     return(depth >= minDepth);
 }