Пример #1
0
 public void EraseSuitsData()
 {
     this.assignedSuit = null;
     this.OgsOld_CompTurretGunFirst  = null;
     this.OgsOld_CompTurretGunSecond = null;
     this.compReloadableDual         = null;
 }
Пример #2
0
        public static bool UnclaimMech(this Pawn pawn, MechSuit AssignedMech)
        {
            if (AssignedMech == null)
            {
                return(false);
            }
            AssignedMech.CompAssignableToPawn.ForceRemovePawn(pawn);
            var comp = Current.Game.GetComponent <MechOwnership>();

            if (comp != null)
            {
                comp.mechOwnerships.Remove(pawn);
            }
            return(true);
        }
Пример #3
0
        public void InitSuitsData(MechSuit suit)
        {
            this.assignedSuit = suit;
            var turrets = assignedSuit.AllComps.Where(x => x is OgsOld_CompTurretGun);

            if (turrets.Count() > 0)
            {
                this.OgsOld_CompTurretGunFirst = turrets.ElementAt(0) as OgsOld_CompTurretGunDamagable;
            }
            if (turrets.Count() > 1)
            {
                this.OgsOld_CompTurretGunSecond = turrets.ElementAt(1) as OgsOld_CompTurretGunDamagable;
            }
            this.compReloadableDual = assignedSuit.GetComp <CompReloadableDual>();
        }
Пример #4
0
        public static bool ClaimMech(this Pawn pawn, MechSuit newSuit)
        {
            if (newSuit.AssignedPawn == pawn)
            {
                return(false);
            }
            UnclaimMech(pawn, newSuit);
            if (newSuit.AssignedPawn != null)
            {
                newSuit.AssignedPawn.UnclaimMech(newSuit);
            }
            newSuit.CompAssignableToPawn.ForceAddPawn(pawn);
            var comp = Current.Game.GetComponent <MechOwnership>();

            if (comp.mechOwnerships == null)
            {
                comp.mechOwnerships = new Dictionary <Pawn, MechSuit>();
            }
            comp.mechOwnerships[pawn] = newSuit;
            return(true);
        }