protected void tryQuest() { if (myQuests.checkQuest()) { if (MetaScript.getRes().roomForResource(ResourceTypes.POPULATION, 1)) { Debug.Log("QUEST COMPLETED"); GetComponentInChildren <SpeechBubble>().setText("Quest Completed"); MetaScript.Poof(transform.position); TakeSoul(); } else { Debug.Log("Not enough population"); GetComponentInChildren <SpeechBubble>().setText("You require additional Pylons... I mean houses"); } } else { Debug.Log("Attempted quest but failed. Need " + myQuests.GetQuestGoal().getThreshold() + " of " + GetQuestType().Name ); gameObject.GetComponentInChildren <SpeechBubble>().setText("Need " + myQuests.GetQuestGoal().getThreshold() + " " + GetQuestType().Name); } }
[HttpDelete("{server}/{database}/script/{uuid}")] public async Task <ActionResult> DeleteScript([FromRoute] Guid server, [FromRoute] Guid database, [FromRoute] Guid uuid) { DatabaseServer srv = Metadata.Servers.Where(s => s.Identity == server).FirstOrDefault(); if (srv == null) { return(NotFound()); } DatabaseInfo db = srv.Databases.Where(db => db.Identity == database).FirstOrDefault(); if (db == null) { return(NotFound()); } MetaScript existing = db.Scripts.Where(scr => scr.Identity == uuid).FirstOrDefault(); if (existing == null) { return(NotFound()); } string catalogName = GetDatabaseCatalog(srv, db); string scriptPath = $"{catalogName}/{uuid.ToString().ToLower()}{SCRIPT_FILE_EXTENSION}"; IFileInfo fileInfo = FileProvider.GetFileInfo(scriptPath); System.IO.File.Delete(fileInfo.PhysicalPath); db.Scripts.Remove(existing); SaveMetadataSettings(); return(Ok()); }
// Use this for initialization void Start() { for (int i = 0; i < (int)ResourceTypes.NumberOfTypes; i++) { MetaScript.getRes().increaseCapacity(i, maxAmount[i]); } }
private void purchase() { for (int i = 0; i < upgradeCostList.Length - 1; i++) { MetaScript.getRes().addResource(i, -upgradeCostList [i]); } }
void Start() { allUIObject = GameObject.Find("AllUIObjectsCanvas"); buildingMenuObject = allUIObject.transform.GetChild(2).gameObject; controls = MetaScript.GetControls(); }
public void purchase() { for (int i = 0; i < cost.Length; i++) { MetaScript.getRes().addResource(i, -cost [i]); } }
// Update is called once per frame void Update() { Vector3 tPos = MetaScript.getPlayer().transform.position; Vector3 pPos = transform.position; navComponent.enabled = true; //navComponent.SetDestination(target.transform.position); float distanceToTarget = Vector3.SqrMagnitude(tPos - pPos); if (distanceToTarget <= Mathf.Pow(followDistance, 2)) { navComponent.isStopped = true; } else if (distanceToTarget >= Mathf.Pow(maxDist, 2)) { navComponent.enabled = false; Vector3 updatePos = (pPos - tPos).normalized * maxDist + tPos; updatePos.y = tPos.y; transform.position = updatePos; navComponent.enabled = true; } else { navComponent.isStopped = false; navComponent.SetDestination(tPos); } }
// Update is called once per frame void Update() { if (controls.keyDown(controls.Outpost) && canSend && buildingPrefabs[0].GetComponent <resourceCost>().canAfford()) { if (MetaScript.getOPController().checkDistance(transform.position)) { if (MetaScript.getOPController().canAddOutPost()) { // Build surrounding area to avoid nav issues MetaScript.getPlayer().GetComponent <DynamicGeneration>().generateSurrounding(Chunk.getChunkPos(transform.position)); canSend = false; buildingPrefabs[0].GetComponent <resourceCost>().purchase(); Instantiate(buildingPrefabsObjects[0], gameObject.transform.position, Quaternion.identity); StartCoroutine(canSendTimer()); MetaScript.getOPController().addOutpost(); } else { Debug.Log("Already at the outpost limit"); } } else { Debug.Log("Campfire too close to other campfire or TC"); } } }
public static void Poof(Vector3 pos) { Vector3 poofPos = pos; poofPos.y = 0.3f; Instantiate(MetaScript.getMeta().PoofAnimation, poofPos, Quaternion.identity); }
// Use this for initialization void Start() { player = MetaScript.getPlayer(); spawnPoint = gameObject; canFire = true; controls = MetaScript.GetControls(); }
// Update is called once per frame void Update() { if (player.GetComponent <Health>().getHealth() <= 0 && MetaScript.GetNPC().getCount() == 0) { gameEnds(); } }
//private GameObject cam; private void Awake() { animator = gameObject.GetComponentInChildren <Animator>(); controls = MetaScript.GetControls(); rpgtalk = GameObject.FindObjectOfType <RPGTalk>(); // cam = GameObject.Find("MainCam"); }
private void getDest() { if (opponent != null) { opponent.SendMessage("stopTargeted", gameObject); } opponent = collect.findClosestTag("OwnedNPC", gameObject); if (opponent != null) { float oppDist = (transform.position - opponent.transform.position).sqrMagnitude; float playerDist = (transform.position - MetaScript.getPlayer().transform.position).sqrMagnitude; if (playerDist < oppDist) { opponent = MetaScript.getPlayer(); } } else { opponent = MetaScript.getPlayer(); } if (opponent != null) { opponent.SendMessage("beingTargeted", gameObject); } }
// Update is called once per frame void Update() { if (player == null) { player = MetaScript.getPlayer(); Debug.Log("Building had to find player again"); } }
public void recieveAction() { MetaScript.preTeleport(); MetaScript.getPlayer().GetComponent <DynamicGeneration>().enabled = false; MetaScript.getPlayer().transform.position = new Vector3(entranceXPos, DEPTH, entranceZPos); MetaScript.getPlayer().GetComponent <InBuilding>().setPlayerInBuilding(true); MetaScript.postTeleport(); }
private void Start() { timer2 = timer; player = MetaScript.getPlayer(); buildingCheck = player.GetComponent <InBuilding>(); controls = MetaScript.GetControls(); }
public void getDirection() { townCentre = MetaScript.getTownCenter(); if (townCentre != null) { travelDirection = (townCentre.transform.position - transform.position).normalized; } }
void OnDisable() { // Unload navmesh and clear handle m_Instance.Remove(); // Notify the player that this navmesh doesn't need to be checked MetaScript.getPlayer().SendMessage("RemResMesh", this); }
public void recieveAction() { for (int i = 0; i < amount.Length; i++) { MetaScript.getRes().addResource(i, amount[i]); } Destroy(gameObject); }
private void drop() { float resMult = MetaScript.getGlobal_Stats().getGatherMultiplier(); curRes = (int)((float)curRes * resMult); MetaScript.getRes().addResource(this.findingType, curRes); curRes = 0; }
void publish() { foreach (IStatsListener l in subscribers) { l.publish(this); } MetaScript.updateGlobalStatsUI(); }
public void recieveAction() { MetaScript.getRes().addResource(myType, 1); SendMessage("damage", 1); if (hasSound) { GetComponent <AudioSource> ().Play(); } }
private static bool takeRes(ResourceTypes i, int a) { if (hasRes(i, a)) { MetaScript.getRes().addResource(i, -a); return(true); } return(false); }
void Start() { textsValuesText = new Text[(int)ResourceTypes.NumberOfTypes]; for (int i = 0; i < (int)ResourceTypes.NumberOfTypes; i++) { textsValuesText [i] = this.transform.GetChild(i).GetChild(0).gameObject.GetComponent <Text> (); } resourceManager = MetaScript.getRes(); updateResourcesUI(); }
public static void Tomb(Vector3 pos, string enslaved) { Vector3 tombPos = pos; tombPos.y = 0.1f; GameObject tomb = Instantiate(MetaScript.getMeta().Tombstone, tombPos, Quaternion.identity); tomb.GetComponent <Tomb>().setName(enslaved); MetaScript.getMeta().souls.AddLast(enslaved); }
private void starving() { foreach (var aNPC in MetaScript.GetNPC().getNPCs().ToArray()) { if (aNPC != null) { aNPC.GetComponent <Health> ().damage(damageForStarving); } } }
protected override void slow(GameObject victim) { if (!MetaScript.getGlobal_Stats().getHasHeatProtection()) { InBuilding shelterCheck = victim.GetComponent <InBuilding>(); if (shelterCheck == null || !shelterCheck.getPlayerInBuilding()) { buffsys.slowApplyingSystem(victim, slowDuration, slowDecimal); } } }
void combat() { Debug.Log("Combat Entered"); if (target != null) { animator.SetBool("attack", true); float damage = gameObject.GetComponent <Skills>().damage *MetaScript.getGlobal_Stats().getMilitaryAbility(); target.GetComponent <Health>().damage(Mathf.RoundToInt(damage)); } }
void Start() { allUIObject = GameObject.Find("AllUIObjectsCanvas"); npcManager = allUIObject.transform.GetChild(0).GetChild(0).gameObject; npcDisplay = allUIObject.transform.GetChild(1).GetChild(0).gameObject; moreDetails = allUIObject.transform.GetChild(1).GetChild(1).gameObject; roleSelect = allUIObject.transform.GetChild(1).GetChild(2).gameObject; controls = MetaScript.GetControls(); }
// Update is called once per frame void Update() { if (inCombat && timeControl) { StartCoroutine(combatManager()); } if (originalMultiplier < MetaScript.getGlobal_Stats().getAtkMultiplier()) { originalMultiplier = MetaScript.getGlobal_Stats().getAtkMultiplier(); damage = Mathf.RoundToInt(baseDamage * originalMultiplier); } }