protected override bool TryExecuteWorker(IncidentParms parms) { Map map = parms.target as Map; IntVec3 intVec; //Find a drop spot if (!CultUtility.TryFindDropCell(map.Center, map, 999999, out intVec)) { return(false); } //Spawn 1 relic Building_LandedShip thing = (Building_LandedShip)ThingMaker.MakeThing(CultsDefOf.Cults_LandedShip, null); GenPlace.TryPlaceThing(thing, intVec.RandomAdjacentCell8Way(), map, ThingPlaceMode.Near); //Spawn 2 treasure chest Building_TreasureChest thing2 = (Building_TreasureChest)ThingMaker.MakeThing(CultsDefOf.Cults_TreasureChest, null); GenPlace.TryPlaceThing(thing2, intVec.RandomAdjacentCell8Way(), map, ThingPlaceMode.Near); Building_TreasureChest thing3 = (Building_TreasureChest)ThingMaker.MakeThing(CultsDefOf.Cults_TreasureChest, null); GenPlace.TryPlaceThing(thing3, intVec.RandomAdjacentCell8Way(), map, ThingPlaceMode.Near); map.GetComponent <MapComponent_SacrificeTracker>().lastLocation = intVec; Messages.Message("Treasures from the deep mysteriously appear.", new TargetInfo(intVec, map), MessageTypeDefOf.PositiveEvent); Cthulhu.Utility.ApplyTaleDef("Cults_SpellBountyOfTheSea", map); return(true); }
protected override bool TryExecuteWorker(IncidentParms parms) { Map map = parms.target as Map; IntVec3 intVec; if (!CultUtility.TryFindDropCell(map.Center, map, 999999, out intVec)) { return(false); } //this.EndOnDespawnedOrNull(this.pawn, JobCondition.Incompletable); for (int i = 0; i < Rand.Range(1, 3); i++) { Building_TreasureChest thing = (Building_TreasureChest)ThingMaker.MakeThing(CultsDefOf.Cults_TreasureChest, null); GenPlace.TryPlaceThing(thing, intVec.RandomAdjacentCell8Way(), map, ThingPlaceMode.Near); } map.GetComponent <MapComponent_SacrificeTracker>().lastLocation = intVec; Messages.Message("Treasures from the deep mysteriously appear.", new TargetInfo(intVec, map), MessageTypeDefOf.PositiveEvent); return(true); }
public override bool TryExecute(IncidentParms parms) { IntVec3 intVec; //Find a drop spot if (!ShipChunkDropCellFinder.TryFindShipChunkDropCell(out intVec, Find.Map.Center, 999999)) { return(false); } //Spawn 1 relic Building_TreasureChest thing = (Building_TreasureChest)ThingMaker.MakeThing(CultDefOfs.TreasureChest_Relic, null); GenPlace.TryPlaceThing(thing, intVec.RandomAdjacentCell8Way(), ThingPlaceMode.Near); //Spawn 1 treasure chest Building_TreasureChest thing2 = (Building_TreasureChest)ThingMaker.MakeThing(CultDefOfs.TreasureChest, null); GenPlace.TryPlaceThing(thing2, intVec.RandomAdjacentCell8Way(), ThingPlaceMode.Near); MapComponent_SacrificeTracker.Get.lastLocation = intVec; Messages.Message("Treasures from the deep mysteriously appear.", intVec, MessageSound.Benefit); return(true); }