private void PartyDefeated(Party.PartyType type) { if (type == Party.PartyType.Player) { Debug.Log("Ya lost."); DebugText.enabled = true; DebugText.text = "Ya Lost"; //SceneManager.LoadScene("FailedScreen"); } else { DebugText.enabled = true; // Tell the table we want to have 2 out of amount //masterTable.rdsCount = 2; commonTable.rdsCount = 2; Debug.Log("Step 1: Just loot 2 out TOTAL table"); for (int i = 0; i < 1; i++) { Debug.Log("Run " + (i + 1)); foreach (ItemBase m in commonTable.rdsResult) { Debug.Log(m); DebugText.text += "\n" + m; } } DebugText.text += "\n\n Don't judge me Matt! :) \n Seriously though thanks for playing!"; //SceneManager.LoadScene("LootScreen"); } }
// Use this for initialization public void Init(CharacterData _char, Party.PartyType type) { partyType = type; data = _char; //HealthBar.onValueChanged.AddListener(OnHealthChanged); //ArmorBar.onValueChanged.AddListener(OnArmorChanged); //ResourceBar.onValueChanged.AddListener(OnResourceChanged); if (data != null) { characterState = CHARACTER_STATE.Idle; Name.text = data.displayName; HealthBar.value = (data.health / data.maxHealth); ArmorBar.value = (data.armor / data.maxArmor); ResourceBar.value = (data.resource / data.maxResource); SetDisplayImage(); } }
public BaseCharacter GetRandomEnemy(Party.PartyType type) { //The party that is getting attacked (is opposite of what is passed in). Ie. if a player calls get random enemy it is looking for //some 1 in the enemy party Party victims = type == Party.PartyType.Enemy ? playerParty : enemyParty; //The party that is attacking Party aggresors = type == Party.PartyType.Enemy ? enemyParty : playerParty; BaseCharacter enemy = null; // Get any party members who aren't fainted also only attack if we are not dead if (victims != null && victims._partyMembers != null && aggresors != null) { var members = victims._partyMembers.Where(pm => pm.characterState != BaseCharacter.CHARACTER_STATE.Fainted).ToList(); if (members.Count > 0) { enemy = members[Random.Range(0, members.Count)]; } } return(enemy); }