private void Awake() { //inicializao de variaveis health = GameObject.FindGameObjectWithTag("Player").GetComponent <Health>(); xp = GameObject.FindGameObjectWithTag("Player").GetComponent <XP>(); baseStats = GameObject.FindGameObjectWithTag("Player").GetComponent <CalcAtb>(); }
public override void OnResponse(NetState sender, RelayInfo info) { PlayerMobile from = (PlayerMobile)sender.Mobile; if (from.Deleted || !from.Alive) { return; } if (info.ButtonID < 8) { base.OnResponse(sender, info); return; } switch (info.ButtonID) { case 8: from.SendGump(new FicheRacesInfoGump(m_from)); break; case 10: if (XP.CanEvolve((PlayerMobile)from)) { XP.Evolve((PlayerMobile)from); } from.SendGump(new FicheRaceGump(from)); break; case 11: from.SendGump(new FicheResetMessageGump(from)); break; } }
void Start() { xp = XP.FindObjectOfType <XP> (); selectorEnemy1 = SelectEnemyScript.FindObjectOfType <SelectEnemyScript> (); selectorEnemy2 = SelectEnemy2Script.FindObjectOfType <SelectEnemy2Script> (); animator = statusTextPanel.GetComponent <Animator> (); music = Music.FindObjectOfType <Music> (); //TURN THIS OFF WHEN BUILDING //music.BattleClip (); enemyFlee = false; playerFlee = false; attackPoints = PlayerPrefs.GetInt("PLAYER_AP"); playerController = PlayerAttackScriptMultipleEnemies.FindObjectOfType <PlayerAttackScriptMultipleEnemies>(); xp.UpdateDisplay(); playerTurn = true; }
private void Awake() { _agent = GetComponent <Agent>(); _xp = GetComponent <XP>(); _xp.OnGainXP += CheckSkillUnlock; CheckSkillUnlock(0); }
private void TurnOptionsOff() { XP.SetActive(false); Points.SetActive(false); Batles.SetActive(false); Monsters.SetActive(false); Potions.SetActive(false); }
void Start() { playerSpeed = GoingToShipAfterBattleScript.FindObjectOfType <GoingToShipAfterBattleScript> (); thankYouText.SetActive(false); credits = XP.FindObjectOfType <XP> (); }
public void SaveUserData() { Dictionary <string, string> userData = new Dictionary <string, string>(); userData["xp"] = XP.ToString(); userData["quest"] = QuestManager.MissionID.ToString(); FileManager.WriteToUser(userData); }
//recebe experiencia private void GainXP(GameObject target) { XP xp = target.GetComponent <XP>();//referencia de xp if (xp == null) { return; //se nao da experiancia } xp.GainXP(GetComponent <CalcAtb>().GetStats(Stats.XP)); //pega quantia de experiancia }
public void SetCentralPos() { Position = new Vector3(-100, 150, 10); this.GetComponent <Text>().alignment = TextAnchor.MiddleRight; Armor.GetComponent <RectTransform>().localPosition = new Vector3(105, 0, 0); HP.GetComponent <RectTransform>().localPosition = new Vector3(105, 0, 0); Fire.GetComponent <RectTransform>().localPosition = new Vector3(105, 0, 0); Coin.GetComponent <RectTransform>().localPosition = new Vector3(105, 0, 0); XP.GetComponent <RectTransform>().localPosition = new Vector3(105, 0, 0); }
void Start() { justWon = false; //smoke.SetActive(false); //bigExplosion.SetActive(false); levelmanager = LevelManager.FindObjectOfType <LevelManager>(); battlecontroller = BattleControllerTurnBased.FindObjectOfType <BattleControllerTurnBased>(); playercontroller = RTSBattleController.FindObjectOfType <RTSBattleController>(); takeAwayEnemy = PlayerPrefs.GetInt("NGC1300NUMBER_OF_ENEMIES") - 1; xp = XP.FindObjectOfType <XP>(); }
public void AddXP(int num_of_people, int flag) { if (flag > 0) { XP.AddXP(num_of_people * XP_per_NPC, POWERTYPE.GOOD); } else { XP.AddXP(num_of_people * XP_per_NPC, POWERTYPE.EVIL); } }
public static XmlElement ReadXml(string xml) { var parser = XP.Element().CreateAbstractValuedParser(); parser.Parse(xml); if (!parser.Success) { throw parser.Exception; } return(parser.Value); }
public SortableBindingList <XPEvent> getCurrentXP() { //Make sure there are enough in there if (!XP.ContainsKey(Session)) { XP.Add(Session, new SortableBindingList <XPEvent>()); } if (XP[Session] == null) { XP[Session] = new SortableBindingList <XPEvent>(); } return(XP[Session]); }
void Start() { playerShipTarget = PlayerShip.GetComponent <Transform> (); playerAccuracy = PlayerPrefs.GetFloat("GUNNER") + 50f; deflectorDamage = PlayerPrefs.GetFloat("DEFLECTORS"); justWon = false; //smoke.SetActive(false); //bigExplosion.SetActive(false); levelmanager = LevelManager.FindObjectOfType <LevelManager>(); battlecontroller = BattleControllerTurnBased.FindObjectOfType <BattleControllerTurnBased>(); playercontroller = RTSBattleController.FindObjectOfType <RTSBattleController>(); takeAwayEnemy = PlayerPrefs.GetInt("NGC1300NUMBER_OF_ENEMIES") - 1; xp = XP.FindObjectOfType <XP>(); }
public override int GetHashCode() { var hashCode = 321779470; hashCode = hashCode * -1521134295 + Id.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Nome); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(FotoPerfil); hashCode = hashCode * -1521134295 + XP.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Status); hashCode = hashCode * -1521134295 + Insignia.GetHashCode(); hashCode = hashCode * -1521134295 + FoiAceito.GetHashCode(); hashCode = hashCode * -1521134295 + ConvidouVoce.GetHashCode(); return(hashCode); }
public static void Niveau_OnCommande(CommandEventArgs e) { if (e.Mobile is PlayerMobile) { PlayerMobile from = (PlayerMobile)e.Mobile; if (XP.CanEvolve(from)) { XP.Evolve(from); } } /*if (from is PlayerMobile) * { * from.Target = new CotationTarget(); * }*/ }
void Start() { transform.LookAt(PlayerShip.transform.position); playerShipTarget = PlayerShip.GetComponent <Transform> (); playerAccuracy = PlayerPrefs.GetFloat("GUNNER") + 50f; deflectorDamage = PlayerPrefs.GetFloat("DEFLECTORS"); levelmanager = LevelManager.FindObjectOfType <LevelManager>(); battlecontroller = BattleControllerTurnBasedMultipleScript.FindObjectOfType <BattleControllerTurnBasedMultipleScript>(); playerController = PlayerAttackScriptMultipleEnemies.FindObjectOfType <PlayerAttackScriptMultipleEnemies>(); xp = XP.FindObjectOfType <XP> (); }
public void OnDamaged(DamagePacket packet) { Health -= packet.damage; Debug.Log(packet.attacker); if (Health <= 0 && packet.attacker != null) { if (OnEntityKilled != null) { Debug.Log("Not even being damaged.."); OnEntityKilled(this, packet.attacker); Debug.Log("MEEEE DEAD"); } else { Debug.Log("Delegate is empty?"); } XP.Give(xpValue); //Destroy (gameObject); } }
public void SetColor(int C) { switch (C) { //HP - red case 1: GetComponent <Text>().color = Color.red; HP.SetActive(true); break; //Armor - grey case 2: GetComponent <Text>().color = Color.grey; Armor.SetActive(true); break; //Coin - yellow case 3: GetComponent <Text>().color = Color.yellow; Coin.SetActive(true); break; //Fire - yellow case 4: GetComponent <Text>().color = Color.yellow; Fire.SetActive(true); break; //Miss case 5: GetComponent <Text>().color = Color.grey; break; //XP case 6: GetComponent <Text>().color = Color.blue; XP.SetActive(true); break; } }
public override int GetHashCode() { var hashCode = -1080711052; hashCode = hashCode * -1521134295 + Id.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(CodUsuario); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Email); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Nome); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(FotoPerfil); hashCode = hashCode * -1521134295 + EqualityComparer <List <Amigo> > .Default.GetHashCode(Amigos); hashCode = hashCode * -1521134295 + EqualityComparer <List <Amigo> > .Default.GetHashCode(Solicitacoes); hashCode = hashCode * -1521134295 + EqualityComparer <List <Tarefa> > .Default.GetHashCode(Tarefas); hashCode = hashCode * -1521134295 + EqualityComparer <List <Meta> > .Default.GetHashCode(Metas); hashCode = hashCode * -1521134295 + EqualityComparer <List <Notificacao> > .Default.GetHashCode(Notificacoes); hashCode = hashCode * -1521134295 + EqualityComparer <List <Acontecimento> > .Default.GetHashCode(Acontecimentos); hashCode = hashCode * -1521134295 + EqualityComparer <List <Item> > .Default.GetHashCode(Itens); hashCode = hashCode * -1521134295 + XP.GetHashCode(); hashCode = hashCode * -1521134295 + Level.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Status); hashCode = hashCode * -1521134295 + Insignia.GetHashCode(); hashCode = hashCode * -1521134295 + Dinheiro.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Titulo); hashCode = hashCode * -1521134295 + TemaSite.GetHashCode(); hashCode = hashCode * -1521134295 + Decoracao.GetHashCode(); hashCode = hashCode * -1521134295 + ConfiguracoesEmail.GetHashCode(); return(hashCode); }
int IComparable <BProtoObjectVeterancy> .CompareTo(BProtoObjectVeterancy other) { if (XP != other.XP) { return(XP.CompareTo(other.XP)); } if (Damage != other.Damage) { return(Damage.CompareTo(other.Damage)); } if (Velocity != other.Velocity) { return(Velocity.CompareTo(other.Velocity)); } if (Accuracy != other.Accuracy) { return(Accuracy.CompareTo(other.Accuracy)); } if (WorkRate != other.WorkRate) { return(WorkRate.CompareTo(other.WorkRate)); } if (WeaponRange != other.WeaponRange) { return(WeaponRange.CompareTo(other.WeaponRange)); } if (DamageTaken != other.DamageTaken) { return(DamageTaken.CompareTo(other.DamageTaken)); } return(0); }
//calculo do lvl public int CalcLvl() { XP xP = GetComponent <XP>();//referencia do xp if (xP == null) { return(startLevel); //checa se tem componente } float currentXP = xP._xp; //xp atual int lastLvl = progression.GetLevelUp(Stats.LvlUp, characterClass); //recebe valor maximo de xp atual for (int lvl = 1; lvl <= lastLvl; lvl++) { //para cada lvl na lista float comparisson = progression.GetStats(Stats.LvlUp, characterClass, lvl); //recebe o valor maximo if (comparisson > currentXP) //caso o valor comparado for maior que o xp atual { return(lvl); //retorna lvl do index atual } } return(lastLvl + 1);//caso nao retorna lvl maximo }
private void XPButton_OnToggleChanged(object sender, XP.ToggleEventArgs args) { Debug.WriteLine("toggle: " + args.IsChecked.ToString()); //args.IsCancel = true; }
public override void OnResponse(NetState sender, RelayInfo info) { PlayerMobile from = (PlayerMobile)sender.Mobile; if (from.Deleted || !from.Alive) { return; } if (info.ButtonID < 8) { base.OnResponse(sender, info); return; } switch (info.ButtonID) { case 8: //Vemotes break; case 9: from.SendGump(new GumpLanguage(from, false)); break; case 10: from.SendGump(new GumpLanguage(from, true)); break; case 11: from.SendMessage(from.Experience.XP.ToString() + " points d'experiences"); break; case 12: //Titre break; case 13: from.SendGump(new ConditionGump((Mobile)from)); break; case 14: from.SendGump(new DecorationGump((Mobile)from)); break; case 15: if (m_chevelurePage > 0) { from.SendGump(new FicheCommandesGump(from, --m_chevelurePage, m_barbePage, m_tatooPage)); } else { from.SendGump(new FicheCommandesGump(from, m_chevelurePage, m_barbePage, m_tatooPage)); } break; case 16: if (m_chevelurePage < CheveluresPages) { from.SendGump(new FicheCommandesGump(from, ++m_chevelurePage, m_barbePage, m_tatooPage)); } else { from.SendGump(new FicheCommandesGump(from, m_chevelurePage, m_barbePage, m_tatooPage)); } break; case 17: if (m_barbePage > 0) { from.SendGump(new FicheCommandesGump(from, m_chevelurePage, --m_barbePage, m_tatooPage)); } else { from.SendGump(new FicheCommandesGump(from, m_chevelurePage, m_barbePage, m_tatooPage)); } break; case 18: if (m_barbePage < BarbesPages) { from.SendGump(new FicheCommandesGump(from, m_chevelurePage, ++m_barbePage, m_tatooPage)); } else { from.SendGump(new FicheCommandesGump(from, m_chevelurePage, m_barbePage, m_tatooPage)); } break; case 19: if (m_tatooPage > 0) { from.SendGump(new FicheCommandesGump(from, m_chevelurePage, m_barbePage, --m_tatooPage)); } else { from.SendGump(new FicheCommandesGump(from, m_chevelurePage, m_barbePage, m_tatooPage)); } break; case 20: if (m_tatooPage < TatooPages) { from.SendGump(new FicheCommandesGump(from, m_chevelurePage, m_barbePage, ++m_tatooPage)); } else { from.SendGump(new FicheCommandesGump(from, m_chevelurePage, m_barbePage, m_tatooPage)); } break; case 21: if (XP.CanEvolve((PlayerMobile)from)) { XP.Evolve((PlayerMobile)from); } from.SendGump(new FicheCommandesGump(from, m_chevelurePage, m_barbePage, m_tatooPage)); break; case 11025: if (from.FindItemOnLayer(Layer.Tatoo) != null) { if (from.FindItemOnLayer(Layer.Tatoo) is GenericTatoo) { from.FindItemOnLayer(Layer.Tatoo).Delete(); } } from.SendGump(new FicheCommandesGump(from, m_chevelurePage, m_barbePage, m_tatooPage)); return; case 12366: from.HairItemID = 0; from.SendGump(new FicheCommandesGump(from, m_chevelurePage, m_barbePage, m_tatooPage)); return; case 12367: from.FacialHairItemID = 0; from.SendGump(new FicheCommandesGump(from, m_chevelurePage, m_barbePage, m_tatooPage)); return; } for (int i = 0; i < m_Chevelures.Length; i++) { if (m_Chevelures[i] == info.ButtonID) { from.HairItemID = info.ButtonID; from.SendGump(new FicheCommandesGump(from, m_chevelurePage, m_barbePage, m_tatooPage)); } } for (int i = 0; i < m_Barbes.Length; i++) { if (m_Barbes[i] == info.ButtonID) { from.FacialHairItemID = info.ButtonID; from.SendGump(new FicheCommandesGump(from, m_chevelurePage, m_barbePage, m_tatooPage)); } } for (int i = 0; i < m_Tatoos.Length; i++) { if (m_Tatoos[i] == info.ButtonID) { GenericTatoo Tatoo = new GenericTatoo(info.ButtonID); if (from.FindItemOnLayer(Layer.Tatoo) != null) { if (from.FindItemOnLayer(Layer.Tatoo) is GenericTatoo) { from.FindItemOnLayer(Layer.Tatoo).Delete(); } } if (!from.EquipItem(Tatoo)) { Tatoo.Delete(); } //from.FacialHairItemID = info.ButtonID; from.SendGump(new FicheCommandesGump(from, m_chevelurePage, m_barbePage, m_tatooPage)); } } }
public void UpdateXP() { XpImage.fillAmount = (float)XP / (float)RequiredXP; XpText.text = XP.ToString() + "/" + RequiredXP.ToString(); }
public void AddXP(int num_of_people, int flag) { XP.AddXP(num_of_people * XP_per_NPC, PowerType); }
void Start() { getCredits = XP.FindObjectOfType <XP> (); }
XP exp; //experiancia private void Awake() { //inicializacao de variaveis exp = GetComponent <XP>(); currentLvl = new LazyValue <int>(CalcLvl); }
private static void Update(Hud __instance) { Player localPlayer = Player.m_localPlayer; if (Main.showCharacterXP.Value && _player == null && localPlayer != null) { _player = localPlayer; XP.Awake(localPlayer); _bar.SetValue(XP.GetLevelPercentage()); } if (!useCustomHud || localPlayer == null) { return; } if (Input.GetKeyDown(Main.toggleEditMode.Value)) { isEditing = !isEditing; CustomHud.ShowTemplates(isEditing, activeLayer); Player.m_localPlayer.Message(MessageHud.MessageType.Center, $"HUD editing is turned {(isEditing ? "ON" : $"OFF")}"); } if (!isEditing) { return; } else if (Input.GetKeyDown(KeyCode.Mouse1)) { activeLayer = activeLayer == CustomHud.roots.Count ? 0 : activeLayer + 1; Helpers.DebugLine($"Layer changed to: {(Groups)activeLayer}"); CustomHud.ShowTemplates(isEditing, activeLayer); Player.m_localPlayer.Message(MessageHud.MessageType.Center, $"Now editing: {(Groups)activeLayer}"); } float gameScale = GameObject.Find("GUI").GetComponent <CanvasScaler>().scaleFactor; Vector3 mousePos = Input.mousePosition; // Select element / move element float scrollPos = Input.GetAxis("Mouse ScrollWheel"); // Change scale // Could maybe rremove this if (!useCustomHud) { lastMousePos = mousePos; return; } if (lastMousePos == Vector3.zero) { lastMousePos = mousePos; } if (lastScrollPos == 0f) { lastScrollPos = scrollPos; } // Could we have this list as global? And only update it every render, no need to re-create? List <KeyValuePair <string, RectTransform> > rectList = new List <KeyValuePair <string, RectTransform> >(); // Check every element, if found add to rectList that is then later scanned if mouse is on them. // Could we use groups, and then toggle between groups. Ex. activeGroup param. foreach (HudElement e in CustomHud.elements) { try { // Get elements only from active layer. RectTransform rt = CustomHud.LocateTemplateRect(e.group, e.name); // Will get every template from different layers.. // Add only rects from active layer if (rt && e.group == (Groups)activeLayer) { rectList.Add(new KeyValuePair <string, RectTransform>(e.name, rt)); } } catch { Helpers.DebugLine($"Issues while locating UI templates. Your uiData might be corrupted.\nIssue on: {e.name} ({e.displayName})"); } } if (Helpers.CheckHeldKey(Main.modKeyPrimary.Value) && rectList.Count > 0) { if (currentlyDragging != "") { var item = rectList.Find(e => e.Key == currentlyDragging); if (item.Key == currentlyDragging) { if (Helpers.CheckHeldKey(Main.modKeySecondary.Value)) { CustomHud.UpdateDimensions(item.Key, scrollPos); } else { CustomHud.UpdatePosition(item.Key, (mousePos - lastMousePos) / gameScale, scrollPos); } } } else { foreach (var item in rectList) { if (RectTransformUtility.RectangleContainsScreenPoint(item.Value, mousePos)) { CustomHud.UpdatePosition(item.Key, (mousePos - lastMousePos) / gameScale, scrollPos); currentlyDragging = item.Key; break; } } } } else { currentlyDragging = ""; } lastMousePos = mousePos; lastScrollPos = scrollPos; // For XP Bar Debug /* * if (_bar != null) * { * * if (_bar.m_value >= 1f) _bar.m_value = 0f; * _bar.SetValue(_bar.m_value + 0.001f); * } */ }
public override string ToString() { return(String.Concat(new string[] { " XP ", XP.ToString(), " Gamer Tag ", GamerTag, " first name ", firstName })); }
private void LoadMap() { for (int x = -11; x <= 11; x++) { for (int y = -5; y <= 5; y++) { string tileName = PlayerPrefs.GetString("Grid-X-" + x + "-Y-" + y); Vector3 position = tilemap.CellToWorld(new Vector3Int(x, y, 0)); int XP; if (tileName != "") { switch (tileName[0]) { case 'C': if (tileName[1] == 'h') { if (tileName == "CharacterA") { tilemap.SetTile(new Vector3Int(x, y, 0), characterA); } else if (tileName == "CharacterB") { tilemap.SetTile(new Vector3Int(x, y, 0), characterB); } } else if (tileName[1] == 'o') { tilemap.SetTile(new Vector3Int(x, y, 0), combat); int combatNumber = 0; if (tileName.Length == 7) { combatNumber = Int32.Parse(tileName[6].ToString()); } if (tileName.Length == 8) { combatNumber = Int32.Parse(tileName[6].ToString() + tileName[7].ToString()); } GameObject combatXP1 = Instantiate(combatXP, position, Quaternion.identity, combatXP.transform.parent); combatXP1.name = "Combat" + combatNumber + "XP"; XP = PlayerPrefs.GetInt("Combat" + combatNumber + "XP"); combatXP1.GetComponent <Text>().text = XP.ToString(); PlayerPrefs.SetString("Combat" + combatNumber + "Coordinates", x.ToString() + y.ToString()); PlayerPrefs.SetString("Grid-X-" + x + "-Y-" + y, "Combat" + combatNumber); } break; case 'M': tilemap.SetTile(new Vector3Int(x, y, 0), miniboss); GameObject minibossXP1 = Instantiate(combatXP, position, Quaternion.identity, combatXP.transform.parent); minibossXP1.name = "MinibossXP"; XP = PlayerPrefs.GetInt("Miniboss-XP"); minibossXP1.GetComponent <Text>().text = XP.ToString(); break; case 'B': tilemap.SetTile(new Vector3Int(x, y, 0), miniboss); GameObject bossXP1 = Instantiate(combatXP, position, Quaternion.identity, combatXP.transform.parent); bossXP1.name = "BossXP"; XP = PlayerPrefs.GetInt("Boss-XP"); bossXP1.GetComponent <Text>().text = XP.ToString(); break; case 'S': tilemap.SetTile(new Vector3Int(x, y, 0), shop); break; case 'G': tilemap.SetTile(new Vector3Int(x, y, 0), gambler); break; case 'E': if (tileName[1] == 's') { tilemap.SetTile(new Vector3Int(x, y, 0), essence); } break; case 'H': tilemap.SetTile(new Vector3Int(x, y, 0), home); break; } } } } }