//-------------------------------Dialogue------------------------------------------------ private void StartGhostDialogue(int talkTarget) { player.PlayZoomInAnimation(ghostTarget[talkTarget].GetPosition()); currentMultiChoice = 0; dialogueBox.ActivateDialogue(); GhostBase ghost = ghostTarget[talkTarget].Ghost.Base; int dialogueSize = ghost.getGhostDialogue().Count; int randomIndex = UnityEngine.Random.Range(0, dialogueSize); dialogueBase = ghostTarget[talkTarget].Ghost.Base.getGhostDialogue()[randomIndex]; if (dialogueBase.ghostLines[dialogueIndex].multiChoices.Length > 0) { //TODO: Show choice state = BattleState.MultiChoice; StartCoroutine(TypeDialogue(BattleState.MultiChoice, dialogueBase.ghostLines[dialogueIndex].text)); playerHud.OpenMulti(); playerHud.UpdateChoice(dialogueBase.ghostLines[dialogueIndex].multiChoices); } else { StartCoroutine(TypeDialogue(BattleState.GhostDialogue, dialogueBase.ghostLines[dialogueIndex].text)); } }
/// <summary> /// Removes the specified ghost object from the element's list of ghosts. /// </summary> /// <param name="ghost">The ghost which is to be removed from the element's list of ghosts.</param> /// <returns>Returns <c>true</c> if the ghost was found and removed from the element's list of ghosts; <c>false</c> if the ghost was not found in the list.</returns> public override bool Remove(GhostBase targetGhost) { if (firstGhost == null) { return(false); } if (ReferenceEquals(firstGhost, targetGhost)) { firstGhost = firstGhost.nextGhost; return(true); } var prevGhost = firstGhost; var nextGhost = firstGhost.nextGhost; while (nextGhost != null) { if (ReferenceEquals(nextGhost, targetGhost)) { prevGhost.nextGhost = nextGhost.nextGhost; return(true); } prevGhost = nextGhost; nextGhost = nextGhost.nextGhost; } return(false); }
public void StartEaten(GhostBase _eatenGhost) { if (!nowStartEaten) { nowStartEaten = true; foreach (GameObject _ghost in ghosts) { _ghost.transform.GetComponent <GhostBase>().isCanMove = false; } player.GetComponent <Player>().isCanMove = false; player.GetComponent <SpriteRenderer>().enabled = false; _eatenGhost.transform.GetComponent <SpriteRenderer>().enabled = false; Vector2 pos = _eatenGhost.transform.position; Vector2 viewPortPoint = mainCamera.WorldToViewportPoint(pos); eatenGhostScoreText.GetComponent <RectTransform>().anchorMin = viewPortPoint; eatenGhostScoreText.GetComponent <RectTransform>().anchorMax = viewPortPoint; eatenGhostScoreText.text = ghostEatenScore.ToString(); eatenGhostScoreText.GetComponent <TextMeshProUGUI>().enabled = true; StartCoroutine(ProgressEatenAfter(0.75f, _eatenGhost)); UpdateUI(); } }
} //properties public void Setup(GhostBase ghost) { Ghost = new Ghost(ghost, level); if (Ghost != null) { GetComponent <Image>().sprite = Ghost.Base.getSprite(); this.gameObject.SetActive(true); } }
/// <summary> /// Checks whether or not the element's list of ghosts contains the specified ghost object. /// </summary> /// <param name="ghost">The ghost which is being searched for in the element's list of ghosts.</param> /// <returns>Returns <c>true</c> if the ghost is found in the element's list of ghosts; <c>false</c> otherwise.</returns> public override bool Contains(GhostBase targetGhost) { var ghost = firstGhost; while (ghost != null) { if (ReferenceEquals(ghost, targetGhost)) { return(true); } ghost = ghost.nextGhost; } return(false); }
public void Setup(GhostBase ghost, int lvl) { level = lvl; Ghost = new Ghost(ghost, level); if (Ghost != null) { GetComponent <Image>().sprite = Ghost.Base.getSprite(); this.gameObject.SetActive(true); } if (Ghost.Base.getName() == "NoGhost") { this.gameObject.SetActive(false); } }
IEnumerator ProgressEatenAfter(float _delay, GhostBase _eatenGhost) { yield return(new WaitForSeconds(_delay)); eatenGhostScoreText.GetComponent <TextMeshProUGUI>().enabled = false; player.GetComponent <SpriteRenderer>().enabled = true; _eatenGhost.GetComponent <SpriteRenderer>().enabled = true; foreach (GameObject _ghost in ghosts) { _ghost.transform.GetComponent <GhostBase>().isCanMove = true; } player.GetComponent <Player>().isCanMove = true; nowStartEaten = false; }
public Ghost(GhostBase ghostBase, int level) { Base = ghostBase; Level = level; Exp = Base.getBaseExp(); moveList = new List <GhostMove>(); foreach (var move in Base.getMoveList()) { moveList.Add(new GhostMove(move.getMoveBase())); } CalculateStats(); HP = MaxHp; StatBoost = new Dictionary <Stat, int>() { { Stat.Attack, 0 }, { Stat.SAttack, 0 }, { Stat.Defense, 0 }, { Stat.SDefense, 0 } }; }
/// <summary> /// Removes the specified ghost object from the element's list of ghosts. /// </summary> /// <param name="ghost">The ghost which is to be removed from the element's list of ghosts.</param> /// <returns>Returns <c>true</c> if the ghost was found and removed from the element's list of ghosts; <c>false</c> if the ghost was not found in the list.</returns> public abstract bool Remove(GhostBase ghost);
/// <summary> /// Checks whether or not the element's list of ghosts contains the specified ghost object. /// </summary> /// <param name="ghost">The ghost which is being searched for in the element's list of ghosts.</param> /// <returns>Returns <c>true</c> if the ghost is found in the element's list of ghosts; <c>false</c> otherwise.</returns> public abstract bool Contains(GhostBase ghost);
public ObjectBase call_object_base(ObjectBaseType objectBaseType, int subType, Node node, int UDLR = 0) { ObjectBase tempbase = null; switch (objectBaseType) { case ObjectBaseType.CHARACTER: tempbase = new PlayerBase((MonsterType)subType, node); break; case ObjectBaseType.MONSTER: if ((MonsterType)subType == MonsterType.ZOMBIE) { tempbase = new ZombieBase((MonsterType)subType, node); } if ((MonsterType)subType == MonsterType.GHOST) { tempbase = new GhostBase((MonsterType)subType, node); } if ((MonsterType)subType == MonsterType.ZOMBIE_TONGUE) { tempbase = new ZombieBase_tongue((MonsterType)subType, node); } if ((MonsterType)subType == MonsterType.GHOST_LV2) { tempbase = new GhostBase((MonsterType)subType, node, 2); } break; case ObjectBaseType.ITEM: tempbase = new ItemBase((ItemType)subType, node); break; case ObjectBaseType.DOOR: if ((DoorType)subType == DoorType.NORMAL) { tempbase = new DoorBase_Normal((DoorType)subType, node, UDLR); } if ((DoorType)subType == DoorType.UP_STAIR) { tempbase = new DoorBase_Upstair((DoorType)subType, node, UDLR); } if ((DoorType)subType == DoorType.DOWN_STAIR) { tempbase = new DoorBase_Downstair((DoorType)subType, node, UDLR); } if ((DoorType)subType == DoorType.LOCKED_DOOR_NORAML) { tempbase = new DoorBase_LockedNormal((DoorType)subType, node, UDLR); } if ((DoorType)subType == DoorType.LOCKED_DOOR_UP_STAIR) { tempbase = new DoorBase_LockedUpstair((DoorType)subType, node, UDLR); } if ((DoorType)subType == DoorType.LOCKED_DOOR_DOWN_STAIR) { tempbase = new DoorBase_LockedDownstair((DoorType)subType, node, UDLR); } break; case ObjectBaseType.BLOCK: if (!checkDoor(node)) { break; } if ((BlockType)subType == BlockType.WELL) { tempbase = new BlockBase_Well((BlockType)subType, node); } if ((BlockType)subType == BlockType.BOX) { tempbase = new BlockBase_Box((BlockType)subType, node); } if ((BlockType)subType == BlockType.CASE) { tempbase = new BlockBase_Case((BlockType)subType, node); } if ((BlockType)subType == BlockType.CASE_LOCKED) { tempbase = new BlockBase_Case_Locked((BlockType)subType, node); } if ((BlockType)subType == BlockType.VENDINGMACHINE) { tempbase = new BlockBase_Vendingmachine((BlockType)subType, node); } if ((BlockType)subType == BlockType.WELL_LOCKED) { tempbase = new BlockBase_Well_Locked((BlockType)subType, node); } break; case ObjectBaseType.TRAP: if ((TrapType)subType == TrapType.MAGICCIRCLE) { tempbase = new TrapBase_Magiccircle((TrapType)subType, node); } if ((TrapType)subType == TrapType.NORMAL) { tempbase = new TrapBase_Normal((TrapType)subType, node); } if ((TrapType)subType == TrapType.NORMAL_TYPE2) { tempbase = new TrapBase_Normal_type2((TrapType)subType, node, false); } if ((TrapType)subType == TrapType.NORMAL_TYPE3) { tempbase = new TrapBase_Normal_type2((TrapType)subType, node, true); } break; default: break; } return(tempbase); /* * if (objectBaseType == ObjectBaseType.CHARACTER) // player경우 pool 안쓰는경우. * { * return new PlayerBase((MonsterType)subType, node); * } * * for (int i = 0; i < object_base_dict[objectBaseType].Count; i++) * { * if (!object_base_dict[objectBaseType][i].is_alive) * { * object_base_dict[objectBaseType][i].init_ObjectBase(objectBaseType, subType, node); * return object_base_dict[objectBaseType][i]; * } * } * create_object_base(objectBaseType, subType, node, UDLR); * return object_base_dict[objectBaseType][object_base_dict[objectBaseType].Count - 1]; */ }
public Ghost(GhostBase ghostBase, int level) { Base = ghostBase; Level = level; }