protected override void Defens() { for (var node = GameManager.instance.monsterOption.AllMonsters.First; node != null; node = node.Next) { ShowMonster monster = node.Value.GetComponent <ShowMonster>(); monster.ondefensPower += defensPower; } }
protected override void Using(GameObject ob) { ShowMonster monster = ob.GetComponent <ShowMonster>(); switch (skill) { case SkILL.FIRE: monster.Fire += cardValue; monster.PowerDown(); if (monster.fireParticle == null) { monster.fireParticle = Instantiate(Resources.Load("Particles/Fire Particle System") as GameObject).GetComponent <ParticleSystem>(); monster.fireParticle.transform.position = monster.transform.position; } SoundManager.Instance.PlaySFX(SoundManager.SFXList.BURNING); break; case SkILL.POISION: monster.Poision += cardValue; if (monster.poisionParticle == null) { monster.poisionParticle = Instantiate(Resources.Load("Particles/Toxin Particle System") as GameObject).GetComponent <ParticleSystem>(); monster.poisionParticle.transform.position = monster.transform.position; } SoundManager.Instance.PlaySFX(SoundManager.SFXList.GLASS_BREAK); break; case SkILL.LIGHTING: monster.Lighting += cardValue; if (monster.lightingParticle == null) { monster.lightingParticle = Instantiate(Resources.Load("Particles/Lighting Particle System") as GameObject).GetComponent <ParticleSystem>(); monster.lightingParticle.transform.position = monster.transform.position; } SoundManager.Instance.PlaySFX(SoundManager.SFXList.THUNDER); break; case SkILL.DEBUFF: monster.Fire = (monster.Fire + cardValue) * 2; monster.Lighting = (monster.Lighting + cardValue) * 2; monster.Poision = (monster.Poision + cardValue) * 2; break; case SkILL.DONT: monster.isDont = true; Knight.instance.defensPower += defensPower; break; } gameObject.SetActive(false); Knight.instance.Sort(); }
IEnumerator Roll(ShowMonster mon, int num) { mon.LoseHp(cardValue); num--; yield return(new WaitForSeconds(0.25f)); if (num <= 0) { StopCoroutine(Roll(mon, num)); gameObject.SetActive(false); Knight.instance.Sort(); } else { StartCoroutine(Roll(mon, num)); } }
IEnumerator DoubleAttack(ShowMonster mon) { mon.LoseHp(cardValue); doubleCnt--; yield return(new WaitForSeconds(0.25f)); if (doubleCnt <= 0) { StopCoroutine(DoubleAttack(mon)); gameObject.SetActive(false); Knight.instance.Sort(); } else { StartCoroutine(DoubleAttack(mon)); } }
protected override void Skill() { for (var node = GameManager.instance.monsterOption.AllMonsters.First; node != null; node = node.Next) { if (!node.Value.activeSelf) { ShowMonster monster = node.Value.GetComponent <ShowMonster>(); monster.hp = hp / 2; monster.gameObject.SetActive(true); monster.ui.SetActive(true); actionCount = 0; action = ACTION.END; StartCoroutine(WaitTime()); return; } } }
void Start() { if (type == TYPE.HP) { set = transform.parent.parent.GetComponent <SetMonster>(); } else { set = transform.parent.GetComponent <SetMonster>(); } mon = set.monster; image = GetComponent <Image>(); text = transform.GetChild(0).GetComponent <Text>(); maxHp = mon.hp; if (mon.mon.name == "kraken") { kk = mon.GetComponent <Kraken>(); } }
protected virtual void Using(GameObject ob) { if (Knight.instance.bCnt > 0) { cardValue = cardValue / 2; } if (Knight.instance.fCnt > 0) { Knight.instance.LoseHp(cardValue); gameObject.SetActive(false); Knight.instance.Sort(); return; } ShowMonster monster = ob.GetComponent <ShowMonster>(); monsterType = monster.mon.type; AddPower(); monster.LoseHp(cardValue); SoundManager.Instance.PlaySFX(SoundManager.SFXList.KNIFE_1); Knight.instance.defensPower += defensPower; gameObject.SetActive(false); Knight.instance.Sort(); }
public void OnGameEnd() { ResultWindow obj = Instantiate(ResultWindowPrefab); int goldCount = 100; int topazCount = 0; int rubyCount = 0; int sapphireCount = 0; int diamondCount = 0; foreach (GameObject gameObj in Spot.nowSpot.sceneOption.objectList) { ShowMonster monster = gameObj.GetComponent <ShowMonster>(); if (monster != null) { switch (monster.mon.type) { case Type.TYPE.RUBY: rubyCount += Random.Range(1, 4); break; case Type.TYPE.SAPPHIRE: sapphireCount += Random.Range(1, 4); break; case Type.TYPE.DIAMOND: diamondCount += Random.Range(1, 4); break; case Type.TYPE.TOPAZ: topazCount += Random.Range(1, 4); break; } } } obj.SetOption(goldCount, topazCount, rubyCount, sapphireCount, diamondCount); }
public virtual void Set(ShowMonster mon) { monster = mon; }
public void Set(ShowMonster mon) { monster = mon; }
protected override void Using(GameObject ob) { if (Knight.instance.bCnt > 0) { cardValue = cardValue / 2; } if (Knight.instance.fCnt > 0) { Knight.instance.LoseHp(cardValue); gameObject.SetActive(false); return; } ShowMonster monster = ob.GetComponent <ShowMonster>(); monsterType = monster.mon.type; AddPower(); switch (skill) { case SKILL.DOUBLE_ATTACK: StartCoroutine(DoubleAttack(monster)); SoundManager.Instance.PlaySFX(SoundManager.SFXList.DOUBLE_KNIFE); break; case SKILL.POWER_ATTACK: monster.LoseHp(cardValue); Knight.instance.LoseHp(3); gameObject.SetActive(false); break; case SKILL.DOUBLE_SWORD: monster.LoseHp((Knight.instance.defensPower + cardValue) * 2); Knight.instance.defensPower = 0; gameObject.SetActive(false); break; case SKILL.ROLL: StartCoroutine(Roll(monster, GameManager.instance.cost + rollCnt)); GameManager.instance.cost -= GameManager.instance.cost; break; case SKILL.HOLY_SWORD: GameManager.instance.holyCnt++; if (GameManager.instance.holyCnt >= 2) { GameManager.instance.holyCnt = 0; monster.LoseHp(monster.hp); } else { monster.LoseHp(cardValue); } gameObject.SetActive(false); break; } Knight.instance.defensPower += defensPower; if (skill != SKILL.DOUBLE_ATTACK) { SoundManager.Instance.PlaySFX(SoundManager.SFXList.KNIFE_1); } Knight.instance.Sort(); }