示例#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);
        }