Esempio n. 1
0
        public void FailConstruction(Pawn worker)
        {
            Map map = base.Map;

            this.Destroy(DestroyMode.FailConstruction);
            Blueprint_Build blueprint_Build = null;

            if (this.def.entityDefToBuild.blueprintDef != null)
            {
                blueprint_Build            = (Blueprint_Build)ThingMaker.MakeThing(this.def.entityDefToBuild.blueprintDef, null);
                blueprint_Build.stuffToUse = base.Stuff;
                blueprint_Build.SetFactionDirect(base.Faction);
                GenSpawn.Spawn(blueprint_Build, base.Position, map, base.Rotation, WipeMode.FullRefund, false);
            }
            Lord lord = worker.GetLord();

            if (lord != null)
            {
                lord.Notify_ConstructionFailed(worker, this, blueprint_Build);
            }
            MoteMaker.ThrowText(this.DrawPos, map, "TextMote_ConstructionFail".Translate(), 6f);
            if (base.Faction == Faction.OfPlayer && this.WorkToBuild > 1400f)
            {
                Messages.Message("MessageConstructionFailed".Translate(new object[]
                {
                    this.LabelEntityToBuild,
                    worker.LabelShort
                }), new TargetInfo(base.Position, map, false), MessageTypeDefOf.NegativeEvent, true);
            }
        }
        public static Blueprint_Build PlaceBlueprintForBuild(BuildableDef sourceDef, IntVec3 center, Map map, Rot4 rotation, Faction faction, ThingDef stuff)
        {
            Blueprint_Build blueprint_Build = (Blueprint_Build)ThingMaker.MakeThing(sourceDef.blueprintDef, null);

            blueprint_Build.SetFactionDirect(faction);
            blueprint_Build.stuffToUse = stuff;
            GenSpawn.Spawn(blueprint_Build, center, map, rotation, WipeMode.Vanish, false);
            return(blueprint_Build);
        }
Esempio n. 3
0
        public static Blueprint_Build PlaceBlueprintForBuild(BuildableDef sourceDef, IntVec3 center, Map map, Rot4 rotation, Faction faction, ThingDef stuff)
        {
            Blueprint_Build obj = (Blueprint_Build)ThingMaker.MakeThing(sourceDef.blueprintDef);

            obj.SetFactionDirect(faction);
            obj.stuffToUse = stuff;
            GenSpawn.Spawn(obj, center, map, rotation);
            return(obj);
        }
Esempio n. 4
0
        public void FailConstruction(Pawn worker)
        {
            Map map = base.Map;

            Destroy(DestroyMode.FailConstruction);
            Blueprint_Build blueprint_Build = null;

            if (def.entityDefToBuild.blueprintDef != null)
            {
                blueprint_Build            = (Blueprint_Build)ThingMaker.MakeThing(def.entityDefToBuild.blueprintDef);
                blueprint_Build.stuffToUse = base.Stuff;
                blueprint_Build.SetFactionDirect(base.Faction);
                GenSpawn.Spawn(blueprint_Build, base.Position, map, base.Rotation, WipeMode.FullRefund);
            }
            worker.GetLord()?.Notify_ConstructionFailed(worker, this, blueprint_Build);
            MoteMaker.ThrowText(DrawPos, map, "TextMote_ConstructionFail".Translate(), 6f);
            if (base.Faction == Faction.OfPlayer && WorkToBuild > 1400f)
            {
                Messages.Message("MessageConstructionFailed".Translate(LabelEntityToBuild, worker.LabelShort, worker.Named("WORKER")), new TargetInfo(base.Position, map), MessageTypeDefOf.NegativeEvent);
            }
        }