public void BreakdownItemSetBonus() { var itemSet = new Item_Set(); itemSet.BonusString = "34:86,2,1|35:5,30,0|36:80,60,0|37:76,2,1|86:10696|"; var random = StaticRandom.Instance.Next(1, 25); var x = (200 * (1 + (float)random / 100)); var random2 = StaticRandom.Instance.Next(80, 120); var y = 2000 * 4 * random2 / 100; }
IEnumerator reactToGetHit(Collider2D origStabber, Item_Set item) { //yield return new WaitForSeconds(1.5f); Debug.Log("INside of react to get hit"); if (getStabBack()) { Debug.Log("WE ARE IN A TRUE STAB BACK"); StartCoroutine(stabBack(origStabber, 0.0f)); if (item.paramet.itemFunction == ItemParams.ITEM_FUNCTION.DEATH) { //Debug.Log ("HE who has stab back on SHOULD be dropping dead"); setDead(true); switchAnim(anim, 3); LevelManager.bDeathInLevel = true; } yield break; } else if (item.paramet.itemFunction == ItemParams.ITEM_FUNCTION.DEATH) { //Debug.Log ("Person who got BACK stabbed droppps dead."); setDead(true); switchAnim(anim, 3); LevelManager.bDeathInLevel = true; if (!origStabber.gameObject.GetComponent <Character>().getDead() && !getStabBack()) { //yield return new WaitForSeconds(0.5f); Debug.Log("WALK BACK BECAUSE THE GUY I STABBED HAS NO STAB BACK"); StartCoroutine(origStabber.gameObject.GetComponent <Character>().walkBackToStartPosition(myStartPosition, 0.0f)); } else if (!origStabber.gameObject.GetComponent <Character>().getDead() && getStabBack()) { yield return(new WaitForSeconds(2.0f)); if (origStabber.gameObject.GetComponent <Character>().getTarget() == null) { StartCoroutine(origStabber.gameObject.GetComponent <Character>().walkBackToStartPosition(myStartPosition, 0.0f)); } } yield return(new WaitForSeconds(0.0f)); } else if (!stabBackON && item.paramet.itemFunction == ItemParams.ITEM_FUNCTION.SETTARGET) { //if the thing that I go hit with is not my color. Debug.Log("I " + this.name + " JUST GOT STUCK WITH A SYRINGE TO SET TARGET"); if (!item.paramet.itemColor.ToString().Equals(charParamet.myColor.ToString())) { setTarget(item.paramet.itemColor); arrived = false; setAttacking(true); } if (!origStabber.gameObject.GetComponent <Character>().getDead() && !getStabBack()) { Debug.Log("WALK BACK BECAUSE THE GUY I STABBED HAS NO STAB BACK"); //yield return new WaitForSeconds(0.5f); StartCoroutine(origStabber.gameObject.GetComponent <Character>().walkBackToStartPosition(myStartPosition, 0.0f)); } else if (!origStabber.gameObject.GetComponent <Character>().getDead() && getStabBack()) { yield return(new WaitForSeconds(2.0f)); if (origStabber.gameObject.GetComponent <Character>().getTarget() == null) { StartCoroutine(origStabber.gameObject.GetComponent <Character>().walkBackToStartPosition(myStartPosition, 0.0f)); } } } yield return(new WaitForSeconds(0.0f)); }
IEnumerator reactToGetHit (Collider2D origStabber, Item_Set item){ //yield return new WaitForSeconds(1.5f); Debug.Log ("INside of react to get hit"); if(getStabBack()){ Debug.Log ("WE ARE IN A TRUE STAB BACK"); StartCoroutine(stabBack(origStabber, 0.0f)); if(item.paramet.itemFunction == ItemParams.ITEM_FUNCTION.DEATH){ //Debug.Log ("HE who has stab back on SHOULD be dropping dead"); setDead(true); switchAnim(anim, 3); LevelManager.bDeathInLevel = true; } yield break; } else if(item.paramet.itemFunction == ItemParams.ITEM_FUNCTION.DEATH){ //Debug.Log ("Person who got BACK stabbed droppps dead."); setDead(true); switchAnim(anim, 3); LevelManager.bDeathInLevel = true; if(!origStabber.gameObject.GetComponent<Character>().getDead() && !getStabBack()){ //yield return new WaitForSeconds(0.5f); Debug.Log ("WALK BACK BECAUSE THE GUY I STABBED HAS NO STAB BACK"); StartCoroutine (origStabber.gameObject.GetComponent<Character>().walkBackToStartPosition (myStartPosition, 0.0f)); } else if(!origStabber.gameObject.GetComponent<Character>().getDead() && getStabBack()){ yield return new WaitForSeconds(2.0f); if(origStabber.gameObject.GetComponent<Character>().getTarget() == null){ StartCoroutine (origStabber.gameObject.GetComponent<Character>().walkBackToStartPosition (myStartPosition, 0.0f)); } } yield return new WaitForSeconds(0.0f); } else if(!stabBackON && item.paramet.itemFunction == ItemParams.ITEM_FUNCTION.SETTARGET){ //if the thing that I go hit with is not my color. Debug.Log ("I "+this.name+ " JUST GOT STUCK WITH A SYRINGE TO SET TARGET"); if (!item.paramet.itemColor.ToString().Equals(charParamet.myColor.ToString())){ setTarget(item.paramet.itemColor); arrived = false; setAttacking(true); } if(!origStabber.gameObject.GetComponent<Character>().getDead() && !getStabBack()){ Debug.Log ("WALK BACK BECAUSE THE GUY I STABBED HAS NO STAB BACK"); //yield return new WaitForSeconds(0.5f); StartCoroutine (origStabber.gameObject.GetComponent<Character>().walkBackToStartPosition (myStartPosition, 0.0f)); } else if(!origStabber.gameObject.GetComponent<Character>().getDead() && getStabBack()){ yield return new WaitForSeconds(2.0f); if(origStabber.gameObject.GetComponent<Character>().getTarget() == null){ StartCoroutine (origStabber.gameObject.GetComponent<Character>().walkBackToStartPosition (myStartPosition, 0.0f)); } } } yield return new WaitForSeconds(0.0f); }