Beispiel #1
0
 private static void RegainWeapon(Pawn pawn)
 {
     if (pawn.equipment.Primary == null)
     {
         PawnWeaponGenerator.TryGenerateWeaponFor(pawn);
     }
 }
 private static void RegainWeapon(Pawn pawn)
 {
     if (pawn.equipment.Primary == null)
     {
         PawnWeaponGenerator.TryGenerateWeaponFor(pawn, new PawnGenerationRequest(pawn.kindDef));
     }
 }
        private static void TryGenerateWeaponFor_Coping(Pawn pawn, Pawn sourcePawn, bool forceWeapon)
        {
            if ((sourcePawn != null) &&
                ((forceWeapon) ||
                 (sourcePawn.RaceProps.Humanlike && pawn.RaceProps.Humanlike) ||
                 (sourcePawn.def == pawn.def)))
            {
                // TODO: Verificar pela arma que foi derrubada

                if (sourcePawn.equipment == null)
                {
                    return;
                }

                while (sourcePawn.equipment.AllEquipment.Any())
                {
                    ThingWithComps equipment;
                    sourcePawn.equipment.TryDropEquipment(sourcePawn.equipment.AllEquipment.First(), out equipment, sourcePawn.Position, true);
                    pawn.equipment.AddEquipment(equipment);
                }
            }
            else
            {
                PawnWeaponGenerator.TryGenerateWeaponFor(pawn);
            }
        }
Beispiel #4
0
 private static void GenerateGearFor(Pawn pawn, PawnGenerationRequest request)
 {
     ProfilerThreadCheck.BeginSample("GenerateGearFor");
     ProfilerThreadCheck.BeginSample("GenerateStartingApparelFor");
     PawnApparelGenerator.GenerateStartingApparelFor(pawn, request);
     ProfilerThreadCheck.EndSample();
     ProfilerThreadCheck.BeginSample("TryGenerateWeaponFor");
     PawnWeaponGenerator.TryGenerateWeaponFor(pawn);
     ProfilerThreadCheck.EndSample();
     ProfilerThreadCheck.BeginSample("GenerateInventoryFor");
     PawnInventoryGenerator.GenerateInventoryFor(pawn, request);
     ProfilerThreadCheck.EndSample();
     ProfilerThreadCheck.EndSample();
 }
Beispiel #5
0
        public void Hatch()
        {
            PawnGenerationRequest request = new PawnGenerationRequest(this.Props.hatcherPawn, this.hatcheeFaction, PawnGenerationContext.NonPlayer, -1, false, true, false, false, true, false, 1f, false, true, true, false, false, false, false, false, 0, null, 1, null, null, null, null, null);
            Pawn hatchling = PawnGenerator.GeneratePawn(request);

            hatchling.SetFactionDirect(Find.FactionManager.FirstFactionOfDef(FactionDef.Named("Horrors")));
            PawnUtility.TrySpawnHatchedOrBornPawn(hatchling, this.parent);
            PawnInventoryGenerator.GenerateInventoryFor(hatchling, request);
            PawnWeaponGenerator.TryGenerateWeaponFor(hatchling, request);
            Lord lord = CreateNewLord();

            lord.AddPawn(hatchling);
            this.parent.Destroy(DestroyMode.Vanish);
        }
Beispiel #6
0
        public void Hatch()
        {
            var request = new PawnGenerationRequest(Props.hatcherPawn, hatcheeFaction, PawnGenerationContext.NonPlayer,
                                                    -1, false, true, false, false, true, false, 1f, false, true, true, false);
            var hatchling = PawnGenerator.GeneratePawn(request);

            hatchling.SetFactionDirect(Find.FactionManager.FirstFactionOfDef(FactionDef.Named("Horrors")));
            PawnUtility.TrySpawnHatchedOrBornPawn(hatchling, parent);
            PawnInventoryGenerator.GenerateInventoryFor(hatchling, request);
            PawnWeaponGenerator.TryGenerateWeaponFor(hatchling, request);
            var lord = CreateNewLord();

            lord.AddPawn(hatchling);
            parent.Destroy();
        }
Beispiel #7
0
 private static void GenerateGearFor(Pawn pawn, PawnGenerationRequest request)
 {
     PawnApparelGenerator.GenerateStartingApparelFor(pawn, request);
     PawnWeaponGenerator.TryGenerateWeaponFor(pawn);
     PawnInventoryGenerator.GenerateInventoryFor(pawn, request);
 }