public CustomFaction(GameplayAffinity iGameplay, VisualAffinity iVisual, List <FactionTrait> iFactionTraits, HomePlanet iHomePlanet, MinorPopulation iPop, PrimaryPopulationModifier iPrim, SecondaryPopulationModifier iSecondary, TertiaryPopulationModifier iTert, PrimaryPolitics iPrimaryPolitics, SecondaryPolitics iSecondaryPolitics1, SecondaryPolitics iSecondaryPolitics2, Government iGovernment, List <Tech> iTech) { _gameplayAffinity = iGameplay; _visualAffinity = iVisual; _factionTraits = iFactionTraits; _homePlanet = iHomePlanet; _minorPopulation = iPop; _primaryPopulationModifier = iPrim; _secondaryPopulationModifier = iSecondary; _tertiaryPopulationModifier = iTert; _primaryPolitics = iPrimaryPolitics; _secondaryPolitics1 = iSecondaryPolitics1; _secondaryPolitics2 = iSecondaryPolitics2; _government = iGovernment; _tech = iTech; _factionName = ""; }
private void AddConnection(OwnedPlanet op) { Raylib.PlaySound(AssetManager.GetSound("connectionCreate")); HomePlanet hp = GetHomePlanet(); _connectedPlanets.Add(new Connection(hp.Pos, op.Position, op.Type)); }
public void Combo() { GameObject comboPlanet = homePlanets[currentViewingPlanet].gameObject; HomePlanet comboHomeInfo = comboPlanet.GetComponent <HomePlanet>(); PlanetCombo combo; if (comboList.Combo(comboHomeInfo.items[0], comboHomeInfo.items[1], comboHomeInfo.items[2]) != null) { combo = comboList.Combo(comboHomeInfo.items[0], comboHomeInfo.items[1], comboHomeInfo.items[2]); comboPlanet.gameObject.name = combo.planet.name; comboPlanet.GetComponent <SpriteRenderer>().sprite = combo.planet.GetComponent <SpriteRenderer>().sprite; comboPlanet.GetComponent <HomePlanet>().productionItems = combo.productionItems; comboPlanet.GetComponent <HomePlanet>().homePlanetInfo.comboIndex = combo.index; resourceInventory.checkForItemAndRemove(getCurrentViewingPlanet().GetComponent <HomePlanet>().items[0].resource.GetComponent <rsrce>().nameOfResource, 1); resourceInventory.checkForItemAndRemove(getCurrentViewingPlanet().GetComponent <HomePlanet>().items[1].resource.GetComponent <rsrce>().nameOfResource, 1); resourceInventory.checkForItemAndRemove(getCurrentViewingPlanet().GetComponent <HomePlanet>().items[2].resource.GetComponent <rsrce>().nameOfResource, 1); getCurrentViewingPlanet().GetComponent <HomePlanet>().removeItem(0); getCurrentViewingPlanet().GetComponent <HomePlanet>().removeItem(1); getCurrentViewingPlanet().GetComponent <HomePlanet>().removeItem(2); getCurrentViewingPlanet().GetComponent <HomePlanet>().UpdateUI(); } }
public OuterRim() { foreach (var character in Characters.All) { HomePlanet.AddCharacter(character); } }
private void DrawConnections() { HomePlanet hp = GetHomePlanet(); foreach (Connection c in _connectedPlanets) { c.Draw(); } }
private void LoadHomePlanet() { HomePlanet homePlanet = EntityFactory.CreateHomePlanet(player.OwnedBy.Empire, 30.0f, 1000.0f, false, 64); homePlanet.Name = "Home Planet"; homePlanet.Position = new Vector2(50, 80); world.PlayerEmpire.HomePlanet = homePlanet; }
void Start() { audioSource = transform.gameObject.GetComponent <AudioSource> (); gameController = GameObject.Find("GameController").GetComponent <Selection>(); homePlanet = GameObject.Find("HomePlanet").GetComponent <HomePlanet> (); target = GameObject.Find("HomePlanet").transform; initialPosition = transform.position; initialRotation = transform.rotation; }
private void Attack(Planet p) { int shipsToAttack = p.Health > GameState.Ships ? GameState.Ships : p.Health; GameState.Ships -= shipsToAttack; HomePlanet hp = Entities.OfType <HomePlanet>().First(); for (int i = 0; i < shipsToAttack; i++) { Raylib.PlaySound(AssetManager.GetSound("shipLaunch")); Entities.Add(new Ship(hp.Pos, p)); } }
private void CheckForConnection() { if (!Raylib.IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON)) { return; } Vector2 worldPos = MouseUtil.ScreenToWorldPosition(Raylib.GetMousePosition() / MoonVars.RenderScale, _camera); HomePlanet p = GetHomePlanet(); if (p.Collides(worldPos)) { if (_currentSelection != null) { AddConnection(_currentSelection); } ClearSelection(); return; } }