public override void SetBasement(SurfaceBlock b, PixelPosByte pos) { if (b == null) { return; } PrepareHouse(b, pos); if (level > 3) { if (rooftop == null) { rooftop = Instantiate(Resources.Load <GameObject>("Structures/HQ_rooftop")); rooftop.transform.parent = transform.GetChild(0); rooftop.transform.localPosition = Vector3.up * (level - 3) * Block.QUAD_SIZE; } if (level > 4) { int i = 5; while (i <= level) { b.myChunk.BlockByStructure(b.pos.x, (byte)(b.pos.y + i - 4), b.pos.z, this); GameObject addon = Instantiate(Resources.Load <GameObject>("Structures/HQ_Addon")); addon.transform.parent = transform.GetChild(0); addon.transform.localPosition = Vector3.zero + (i - 3.5f) * Vector3.up * Block.QUAD_SIZE; addon.transform.localRotation = transform.GetChild(0).localRotation; i++; } BoxCollider bc = transform.GetChild(0).GetComponent <BoxCollider>(); bc.center = Vector3.up * (level - 3) * Block.QUAD_SIZE / 2f; bc.size = new Vector3(Block.QUAD_SIZE, (level - 3) * Block.QUAD_SIZE, Block.QUAD_SIZE); } } colony = GameMaster.colonyController; colony.SetHQ(this); }
override public void SetBasement(SurfaceBlock b, PixelPosByte pos) { if (hireCost == -1) { ResetToDefaults_Static_RecruitingCenter(); } bool movement = false; if (basement != null) { movement = true; } if (b == null) { return; } SetBuildingData(b, pos); if (!subscribedToUpdate) { GameMaster.realMaster.labourUpdateEvent += LabourUpdate; subscribedToUpdate = true; } colonyController = GameMaster.colonyController; if (!movement) // здание не создавалось, а было перенесено { Crew.AddCrewSlots(CREW_SLOTS_FOR_BUILDING); progress = 0; } }
override public void SetBasement(SurfaceBlock b, PixelPosByte pos) { if (b == null) { return; } SetBuildingData(b, pos); Transform modelTransform = transform.GetChild(0); if (basement.pos.z == 0) { modelTransform.transform.localRotation = Quaternion.Euler(0, 180, 0); } else { if (basement.pos.z != Chunk.CHUNK_SIZE - 1) { if (basement.pos.x == 0) { modelTransform.transform.localRotation = Quaternion.Euler(0, -90, 0); } else { if (basement.pos.x == Chunk.CHUNK_SIZE - 1) { modelTransform.transform.localRotation = Quaternion.Euler(0, 90, 0); } } } } hangarsCount++; }
protected void PrepareHouse(SurfaceBlock b, PixelPosByte pos) { SetBuildingData(b, pos); GameMaster.colonyController.AddHousing(this); switch (id) { case LANDED_ZEPPELIN_ID: housing = 10; break; case HQ_2_ID: housing = 30; break; case HQ_3_ID: housing = 40; break; case HQ_4_ID: housing = 45; break; case HOUSE_0_ID: housing = 2; break; case HOUSE_1_ID: housing = 10; break; case HOUSE_2_ID: housing = 50; break; case HOUSE_3_ID: housing = 100; break; case HOUSE_5_ID: housing = 800; break; } }
public void Set(SurfaceBlock block, ResourceType type) { workObject = block; workObject.SetWorksite(this); rtype = type; actionLabel = Localization.GetStructureName(Structure.RESOURCE_STICK_ID); GameMaster.colonyController.SendWorkers(START_WORKERS_COUNT, this); if (!worksitesList.Contains(this)) { worksitesList.Add(this); } if (!subscribedToUpdate) { GameMaster.realMaster.labourUpdateEvent += WorkUpdate; subscribedToUpdate = true; } if (sign == null) { sign = new GameObject().AddComponent <WorksiteSign>(); BoxCollider bc = sign.gameObject.AddComponent <BoxCollider>(); bc.size = new Vector3(Block.QUAD_SIZE, 0.1f, Block.QUAD_SIZE); bc.center = Vector3.up * 0.05f; sign.worksite = this; sign.transform.position = workObject.transform.position; } }
override public void SetBasement(SurfaceBlock b, PixelPosByte pos) { if (b == null) { return; } //#setStructureData basement = b; innerPosition = new SurfaceRect(pos.x, pos.y, innerPosition.size); if (model == null) { SetModel(); } b.AddStructure(this); // isbasement check deleted //--- if (!addedToClassList) { corns.Add(this); addedToClassList = true; if (((existingPlantsMask >> CROP_CORN_ID) & 1) != 1) { int val = 1; val = val << CROP_CORN_ID; existingPlantsMask += val; } } }
public void Set(SurfaceBlock block, bool f_diggingMission) { workObject = block; workObject.SetWorksite(this); if (block.grassland != null) { block.grassland.Annihilation(true); } if (sign == null) { sign = Instantiate(Resources.Load <GameObject> ("Prefs/ClearSign")).GetComponent <WorksiteSign>(); } sign.worksite = this; sign.transform.position = workObject.transform.position; //FollowingCamera.main.cameraChangedEvent += SignCameraUpdate; diggingMission = f_diggingMission; if (workersCount < START_WORKERS_COUNT) { GameMaster.colonyController.SendWorkers(START_WORKERS_COUNT, this); } if (!worksitesList.Contains(this)) { worksitesList.Add(this); } if (!subscribedToUpdate) { GameMaster.realMaster.labourUpdateEvent += WorkUpdate; subscribedToUpdate = true; } }
// в финальном виде копипастить в потомков protected void LoadStructureData(StructureSerializer ss, SurfaceBlock sblock) { modelRotation = ss.modelRotation; indestructible = ss.undestructible; SetBasement(sblock, ss.pos); maxHp = ss.maxHp; hp = ss.maxHp; }
private void Scheme_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (_isPalletSelected) { return; } var mousePoint = e.GetPosition(WindowWarehouse); SurfaceWarehouse.UpdateLayout(); SurfaceBlock.UpdateLayout(); var surfaseWarehousePoint = SurfaceWarehouse.TranslatePoint(new Point(0, 0), WindowWarehouse); var surfaseBlockPoint = SurfaceBlock.TranslatePoint(new Point(0, 0), WindowWarehouse); if (!(surfaseWarehousePoint.X <= mousePoint.X && (surfaseWarehousePoint.X + _schemeDrawingWarehouse.Size.Width) >= mousePoint.X && surfaseWarehousePoint.Y <= mousePoint.Y && (surfaseWarehousePoint.Y + _schemeDrawingWarehouse.Size.Height) >= mousePoint.Y) && !(surfaseBlockPoint.X <= mousePoint.X && (surfaseBlockPoint.X + _schemeDrawingBlock.Size.Width) >= mousePoint.X && surfaseBlockPoint.Y <= mousePoint.Y && (surfaseBlockPoint.Y + _schemeDrawingBlock.Size.Height) >= mousePoint.Y)) { SurfaceWarehouse.Children.Clear(); _schemeDrawingWarehouse.DrawWarehouse(_warehouseSizeCell, _warehouseSizeRoad, _warehouseFontSize); _schemeDrawingWarehouse.SelectedBlock = null; SurfaceBlock.Children.Clear(); } }
public Expedition Load(ExpeditionSerializer es) { ID = es.ID; shuttles = new List <Shuttle>(); if (es.shuttles_ID.Count > 0) { foreach (int i in es.shuttles_ID) { AssignShuttle(Shuttle.GetShuttle(i)); } } progress = es.progress; if (es.haveTransmitter) { SurfaceBlock transmitterBasis = GameMaster.mainChunk.GetBlock(es.transmitterPosition) as SurfaceBlock; foreach (Structure s in transmitterBasis.surfaceObjects) { if (s is QuantumTransmitter) { transmitter = s as QuantumTransmitter; transmitter.SetExpedition(this); break; } } } else { transmitter = null; } return(this); }
override public void Load(StructureSerializer ss, SurfaceBlock sblock) { LoadStructureData(ss, sblock); HarvestableResourceSerializer hrs = new HarvestableResourceSerializer(); GameMaster.DeserializeByteArray <HarvestableResourceSerializer>(ss.specificData, ref hrs); SetResources(ResourceType.GetResourceTypeById(hrs.mainResource_id), hrs.count); }
virtual public void SetBasement(SurfaceBlock b, PixelPosByte pos) { if (b == null) { return; } SetStructureData(b, pos); }
override public void Load(StructureSerializer ss, SurfaceBlock sblock) { LoadStructureData(ss, sblock); WorkBuildingSerializer wbs = new WorkBuildingSerializer(); GameMaster.DeserializeByteArray <WorkBuildingSerializer>(ss.specificData, ref wbs); LoadWorkBuildingData(wbs); }
override public void Load(StructureSerializer ss, SurfaceBlock sblock) { LoadStructureData(ss, sblock); PlantSerializer ps = new PlantSerializer(); GameMaster.DeserializeByteArray <PlantSerializer>(ss.specificData, ref ps); LoadPlantData(ps); }
override public void SetBasement(SurfaceBlock b, PixelPosByte pos) { if (b == null) { return; } PrepareMultiblockStructure(b, pos); }
public void ResolveAdd(Block inblock, string key, string value) { placeBlockByInBlockId[inblock.BlockId] = PlaceBlock.Resolve(variant.fromFile, Api, inblock, key, value); if (SurfaceBlock != null) { surfaceBlockByInBlockId[inblock.BlockId] = SurfaceBlock.Resolve(variant.fromFile, Api, inblock, key, value); } }
override public void Load(StructureSerializer ss, SurfaceBlock sblock) { LoadStructureData(ss, sblock); DockSerializer ds = new DockSerializer(); GameMaster.DeserializeByteArray <DockSerializer>(ss.specificData, ref ds); LoadDockData(ds); }
override public void Load(StructureSerializer ss, SurfaceBlock sblock) { LoadStructureData(ss, sblock); MineSerializer ms = new MineSerializer(); GameMaster.DeserializeByteArray(ss.specificData, ref ms); LoadMineData(ms); }
public override void SetBasement(SurfaceBlock b, PixelPosByte pos) { if (b == null) { return; } PrepareHouse(b, pos); }
override public void Load(StructureSerializer ss, SurfaceBlock sblock) { LoadStructureData(ss, sblock); FactorySerializer fs = new FactorySerializer(); GameMaster.DeserializeByteArray(ss.specificData, ref fs); LoadFactoryData(fs); }
override public void SetBasement(SurfaceBlock b, PixelPosByte pos) { if (b == null) { return; } SetBuildingData(b, pos); }
override public void SetBasement(SurfaceBlock b, PixelPosByte pos) { if (b == null) { return; } SetBuildingData(b, pos); GameMaster.colonyController.storage.AddWarehouse(this); }
override public void Load(StructureSerializer ss, SurfaceBlock sblock) { LoadStructureData(ss, sblock); RollingShopSerializer rss = new RollingShopSerializer(); GameMaster.DeserializeByteArray <RollingShopSerializer>(ss.specificData, ref rss); LoadWorkBuildingData(rss.workBuildingSerializer); mode = rss.mode; }
protected void SetBuildingData(SurfaceBlock b, PixelPosByte pos) { SetStructureData(b, pos); isActive = true; if (energySurplus != 0 || energyCapacity > 0) { GameMaster.colonyController.AddToPowerGrid(this); connectedToPowerGrid = true; } }
public override void SetBasement(SurfaceBlock b, PixelPosByte pos) { if (b == null) { return; } SetBuildingData(b, pos); coverage = 0; GameMaster.colonyController.AddHospital(this); }
override public void Load(StructureSerializer ss, SurfaceBlock sblock) { LoadStructureData(ss, sblock); HangarSerializer hs = new HangarSerializer(); GameMaster.DeserializeByteArray <HangarSerializer>(ss.specificData, ref hs); constructing = hs.constructing; LoadWorkBuildingData(hs.workBuildingSerializer); shuttle = Shuttle.GetShuttle(hs.shuttle_id); }
override public void SetBasement(SurfaceBlock b, PixelPosByte pos) { if (b == null) { return; } SetStructureData(b, pos); transform.GetChild(0).localScale = new Vector3(1, 0, 1); //if (isBasement) basement.myChunk.chunkUpdateSubscribers_structures.Add(this); }
override public void SetBasement(SurfaceBlock b, PixelPosByte pos) { if (b == null) { return; } SetStructureData(b, pos); (myRenderer as LineRenderer).SetPosition(0, transform.position); (myRenderer as LineRenderer).SetPosition(1, transform.position + Vector3.up * startSize); }
override public void Load(StructureSerializer ss, SurfaceBlock sb) { HeadQuartersSerializer hqs = new HeadQuartersSerializer(); GameMaster.DeserializeByteArray <HeadQuartersSerializer>(ss.specificData, ref hqs); level = hqs.level; LoadStructureData(ss, sb); LoadBuildingData(hqs.buildingSerializer); nextStageConditionMet = hqs.nextStageConditionMet; }
override public void Load(StructureSerializer ss, SurfaceBlock sblock) { LoadStructureData(ss, sblock); RecruitingCenterSerializer rcs = new RecruitingCenterSerializer(); GameMaster.DeserializeByteArray <RecruitingCenterSerializer>(ss.specificData, ref rcs); LoadWorkBuildingData(rcs.workBuildingSerializer); backupSpeed = rcs.backupSpeed; finding = rcs.finding; progress = rcs.progress; }