public void CompleteQuest() { if (selectedQuest.IsComplete) { for (int i = 0; i < questGiver.MyQuests.Length; i++) { if (selectedQuest == questGiver.MyQuests[i]) { questGiver.MyCompletedQuest.Add(selectedQuest.MyTitle); questGiver.MyQuests[i] = null; selectedQuest.MyQuestGiver.UpdateQuestStatus(); } } foreach (CollectObjective objective in selectedQuest.MyCollectObjectives) { InventoryScript.MyInstance.itemCountChangedEvent -= new ItemCountChanged(objective.UpdateItemCount); objective.Complete(); } foreach (KillObjective objective in selectedQuest.MyKillObjectives) { GameManager.MyInstance.killConfirmedEvent -= new KillConfirmed(objective.UpdateKillCount); } Player.MyInstance.GainXp(XPManager.CalculateXP(selectedQuest)); QuestLog.MyInstance.RemoveQuest(selectedQuest.MyQuestScript); Back(); } }
public Bird(Level level, Yat yat, Texture2D spriteSheet, SoundEffectInstance hawk, Vector2 frameSize, Vector2 position, float angle, XPManager xpgen, Rectangle window) { this.animationSpeed = 50; this.level = level; this.yat = yat; this.spriteSheet = spriteSheet; this.hawk = hawk; this.frameSize = frameSize; this.framesX = (int)(spriteSheet.Width / frameSize.X); this.framesY = (int)(spriteSheet.Height / frameSize.Y); this.Position = position; this.attackAngle = angle; this.xpgen = xpgen; this.window = window; this.Attacking = false; this.gotYat = false; }
public void showTargetFrame(Enemy target) { targetFrame.SetActive(true); healthStat.Initialize(target.MyHealth.MyCurrentValue, target.MyHealth.MyMaxValue); targetName.text = target.MyName; targetLevel.text = target.MyLevel.ToString(); target.healthChanged += new HealthChanged(updateTargetFrame); target.characterRemoved += new CharacterRemoved(hideTargetFrame); if (target.MyLevel >= Player.MyInstance.MyLevel + 5) { targetName.color = Color.red; } else if ((target.MyLevel == Player.MyInstance.MyLevel + 3) || (target.MyLevel == Player.MyInstance.MyLevel + 4)) { targetName.color = new Color32(255, 124, 0, 255); } else if ((target.MyLevel >= Player.MyInstance.MyLevel - 2) && (target.MyLevel <= Player.MyInstance.MyLevel + 2)) { targetName.color = Color.yellow; } else if (target.MyLevel <= Player.MyInstance.MyLevel - 3 && target.MyLevel > XPManager.CalculateGrayLevel()) { targetName.color = Color.green; } else { targetName.color = Color.gray; } }
public void ShowTargetFrame(Enemy target) { targetFrame.SetActive(true); healthStat.Initialize(target.MyHealth.MyCurrentValue, target.MyHealth.MyMaxValue); portraitFrame.sprite = target.MyPortrait; levelTexet.text = target.MyLevel.ToString(); target.healthChanged += new HealthChanged(UpdateTargetFrame); target.characterRemoved += new CharacterRemoved(HideTargetFrame); if (target.MyLevel >= Hero.MyInstance.MyLevel + 5) { levelTexet.color = Color.red; } else if (target.MyLevel == Hero.MyInstance.MyLevel + 3 || target.MyLevel == Hero.MyInstance.MyLevel + 4) { levelTexet.color = new Color32(255, 124, 0, 255); } else if (target.MyLevel >= Hero.MyInstance.MyLevel - 2 && target.MyLevel <= Hero.MyInstance.MyLevel + 2) { levelTexet.color = Color.yellow; } else if (target.MyLevel <= Hero.MyInstance.MyLevel - 3 && target.MyLevel > XPManager.CalculateGrayLevel()) { levelTexet.color = Color.green; } else { levelTexet.color = Color.grey; } }
// protected override void FixedUpdate() // { // base.FixedUpdate(); // } public IEnumerator TakeDamage(float playerDamage) { if (!isDead) { health.MyCurrentValue -= playerDamage; CombatTextManager.MyInstance.CreateText(transform.position, playerDamage.ToString(), SCTTYPE.DAMAGE, false); if (health.MyCurrentValue <= 0) { isDead = true; animator.SetTrigger("Dead"); hitBox.size = new Vector2(0, 0); canvas.enabled = false; GameManager.MyInstance.OnKillConfirmed(this); // if (this is Enemy) Eeola.MyInstance.GainXp(XPManager.CalculateXP(this as Enemy)); yield return(new WaitForSeconds(1)); //gameObject.GetComponent<SpriteRenderer>().enabled = false; // Destroy(gameObject); if (TakeDamageCoroutine != null) { StopCoroutine(TakeDamageCoroutine); } } } }
public void CompleteQuest() { //퀘스트를 클리어시 NPC의 퀘스트들중에 찾아서 비활성화 if (selectedQuest.IsComplete) { for (int i = 0; i < questGiver.MyQuests.Length; i++) { if (selectedQuest == questGiver.MyQuests[i]) { questGiver.MyCompltedQuests.Add(selectedQuest.MyTitle); questGiver.MyQuests[i] = null; selectedQuest.MyQuestGiver.UpdateQuestStatus(); } } foreach (CollectObjective o in selectedQuest.MyCollectObjectives) { InventoryScript.instance.itemCountChangedEvent -= new ItemCountChanged(o.UpdateItemCount); o.Complete(); } foreach (KillObjective o in selectedQuest.MyKillObjectives) { GameManager.instance.killConfirmedEvent -= new KillConfirmed(o.UpdateKillCount); } //함수 오버로딩 ->퀘스트와 몹변수를 받을 수 있음 Player.instance.GainXP(XPManager.CalculateXP((selectedQuest))); Questlog.instance.RemoveQuest(selectedQuest.MyQuestScript); Back(); } }
public override void Act(XPManager controller) { MAIAManager manager = controller as MAIAManager; if (manager != null) { manager.LaunchVictory(); } }
public override void Act(XPManager controller) { MAIAManager manager = controller as MAIAManager; if (manager != null) { manager.ResetHologram(); } }
public override void Act(XPManager controller) { MAIAManager manager = controller as MAIAManager; if (manager != null) { manager.StartHologramTubeAnimation(); } }
public BirdFactory(Level level, Yat yat, Texture2D spriteSheet, SoundEffect hawk, XPManager xpgen, Rectangle window) { this.level = level; this.yat = yat; this.spriteSheet = spriteSheet; this.hawk = hawk; this.xpgen = xpgen; this.window = window; }
// Start is called before the first frame update void Start() { xpBeforeGame = XPManager.GetStoredXP(); xpAfterGame = xpBeforeGame + XPManager.GetEarnedXP(); XPManager.StoreEarnedXP(); round = SessionManager.currentRound; SceneManager.sceneLoaded += OnLevelLoad; DontDestroyOnLoad(gameObject); }
void OnDisable() { if (xpManager == null) { return; } XPManager xpManagerScript = xpManager.GetComponent <XPManager>(); xpManagerScript.addXPEvent -= UpdateBar; }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
private void Awake() { if (Instance != null && Instance != this) { Destroy(gameObject); } else { Instance = this; } }
public static int StoreEarnedXP() { int x = GetStoredXP(); x += XPManager.GetEarnedXP(); PlayerPrefs.SetInt("XP", x); PlayerPrefs.Save(); return(x); }
void OnEnable() { if (xpManager == null) { Debug.LogWarning($"XPManager not choosen"); return; } XPManager xpManagerScript = xpManager.GetComponent <XPManager>(); xpManagerScript.addXPEvent += UpdateBar; }
void Awake() { if (xpmanager != null) { Destroy(gameObject); } else { xpmanager = this; GameObject.DontDestroyOnLoad(gameObject); } }
public void ShowTargetFrame(Enemy target) { targetFrame.SetActive(true); healthStat.Initialize(target.MyHealth.MyCurrentValue, target.MyHealth.MyMaxValue); portraitFrame.sprite = target.MyPortrait; levelText.text = target.MyLevel.ToString(); target.healthChanged += new HealthChanged(UpdateTargetFrame); target.characterRemoved += new CharacterRemoved(HideTargetFrame); if (target.MyLevel >= Player.MyInstance.MyLevel + 5) { levelText.color = Color.red; } else if (target.MyLevel == Player.MyInstance.MyLevel + 3 || target.MyLevel == Player.MyInstance.MyLevel + 4) { levelText.color = new Color32(255, 124, 0, 255); } else if (target.MyLevel >= Player.MyInstance.MyLevel - 2 && target.MyLevel <= Player.MyInstance.MyLevel + 2) { levelText.color = Color.yellow; } else if (target.MyLevel <= Player.MyInstance.MyLevel - 3 && target.MyLevel > XPManager.CalculateGrayLevel()) { levelText.color = Color.green; } else { levelText.color = Color.grey; } for (int i = 0; i < targetDebuffs.Count; i++) { Destroy(targetDebuffs[i].gameObject); } targetDebuffs.Clear(); foreach (Debuff debuff in target.MyDebuffs) { TargetDebuff td = Instantiate(targetDebuffPrefab, targetDebuffsTransform); td.Initialize(debuff); targetDebuffs.Add(td); } }
/// <summary> /// Clic sur le bouton Terminer : Termine la quête /// </summary> public void CompleteQuest() { // Si la quête sélectionnée est "Terminée" if (selected.IsComplete) { // Pour chaque quête for (int i = 0; i < questGiver.MyQuests.Length; i++) { // Si la quête sélectionnée est la même que celle du donneur de quêtes if (selected == questGiver.MyQuests[i]) { // Retire la quête de la liste questGiver.MyQuests[i] = null; // Ajoute la quête dans le liste des complètes questGiver.MyCompletedQuests.Add(selected.MyTitle); // Actualise le statut de la quête selected.MyQuestGiver.UpdateQuestStatus(); } } // Pour chacun des objectifs de collecte de la quête foreach (CollectObjective collectObjective in selected.MyCollectObjectives) { // Désabonnement sur l'évènement de mise à jour du nombre d'élements de l'item InventoryScript.MyInstance.ItemCountChangedEvent -= new ItemCountChanged(collectObjective.UpdateItemCount); // Complète l'objectif de collecte collectObjective.Complete(); } // Pour chacun des objectifs d'ennemi de la quête foreach (KillObjective killObjective in selected.MyKillObjectives) { // Désabonnement sur l'évènement de la mort d'un personnage GameManager.MyInstance.KillConfirmedEvent -= new KillConfirmed(killObjective.UpdateKillCount); } // Gagne l'expérience calculée Player.MyInstance.GainXP(XPManager.CalculateXP(selected)); // Retire la quête QuestWindow.MyInstance.RemoveQuest(selected.MyQuestScript); // Retourne à la liste des quêtes Back(); } }
public static void OnScore(int amount) { CashManager.AddCash(amount); int preMultiplier = CashManager.Multiplier; XPManager.AddXP(amount * preMultiplier); CashManager.AddMultiplier(); if (CashManager.Multiplier != preMultiplier) { if (OnMultiplierChange != null) { OnMultiplierChange(CashManager.Multiplier); } } }
public override void DamageTakenStun(float damage, Transform source) { if (!(currentState is EvadeState)) { if (IsAlive) { SetTarget(source); base.DamageTakenStun(damage, source); OnHealthChanged(health.MyCurrentValue); if (gameObject.tag == "Boss") { BossVoice.MyInstance.BossAttackedVoice(); } else if (gameObject.tag == "Enemy") { EnemyVoice.MyInstance.EnemyAttacked(); } if (!IsAlive) { if (gameObject.tag == "Enemy") { EnemyVoice.MyInstance.EnemyDeath(); } if (gameObject.tag == "Boss") { BossVoice.MyInstance.BossDeath(); } enemySprite.sortingOrder = -1; enemyCC2D.isTrigger = true; Player.MyInstance.MyAttackers.Remove(this); Player.MyInstance.GainXp(XPManager.CalculateXP(this as Enemy)); Player.MyInstance.StartCoroutine(Player.MyInstance.GainGold(goldValue)); } } } }
/// <summary> /// Makes the enemy take damage when hit /// </summary> /// <param name="damage"></param> public override void TakeDamage(float damage, Character source) { if (!(currentState is EvadeState)) { if (IsAlive) { SetTarget(source); base.TakeDamage(damage, source); OnHealthChanged(health.MyCurrentValue); if (!IsAlive) { source.RemoveAttacker(this); Player.MyInstance.GainXP(XPManager.CalculateXP((this as Enemy))); } } } }
public MushroomFactory(Texture2D spriteSheet, Texture2D fireSheet, Vector2 frameSize, Level level, Yat yat, SoundEffect fire, SoundEffect sound, XPManager xpgen, Rectangle window) { this.spriteSheet = spriteSheet; this.fireballSheet = fireSheet; this.frameSize = frameSize; this.level = level; this.yat = yat; this.fire = fire; this.sound = sound; this.xpgen = xpgen; this.window = window; }
public void ActivateXpPanel() { int currentLevel = XPManager.CalculateLevel(xpBeforeGame, XPManager.MAP_XP_BOUNDARIES); DisplayMapTeaser(currentLevel); XpPanel.SetActive(true); mapLevel.OnDone += OnMapLevelUpDone; mapLevel.OnLevelUp += DisplayMapTeaser; if (xpBeforeGame < XPManager.MAP_LEVEL_CAP) { Invoke("OnXpPanelActive", 0.4f); } else { OnMapLevelUpDone(); } currentLevel = XPManager.CalculateLevel(xpBeforeGame, XPManager.SKIN_XP_BOUNDARIES); DisplaySkinTeaser(currentLevel); }
public void ShowTargetFrame(Enemy target) { targetFrame.SetActive(true); heathStat.Initialize(target.Health.MyCurrentValue, target.Health.MyMaxValue); portraitFrame.sprite = target.MyPortrait; levelText.text = target.MyLevel.ToString(); //적의 체력이 변경시에 실행하는 함수 target.healthChanged += new HealthChanged(UpdateTargetFrame); //적이 죽거나 다른 몹으로 타겟팅시 실행하는 함수 target.characterRemoved += new CharacterRemoved(HideTargetFrame); //적 레벨이 5이상 높을경우 if (target.MyLevel >= Player.instance.MyLevel + 5) { levelText.color = Color.red; } //적 레벨이 3, 4이상 높을경우 else if (target.MyLevel == Player.instance.MyLevel + 3 || target.MyLevel == Player.instance.MyLevel + 4) { levelText.color = new Color32(255, 124, 0, 255); } // 적 레벨과 플레이어레벨이 -2 ~ + 2 인경우 else if (target.MyLevel >= Player.instance.MyLevel - 2 && target.MyLevel <= Player.instance.MyLevel + 2) { levelText.color = Color.yellow; } // 적 레벨이 플레이어보다 3이상 낮은경우 또는 플레이어 레벨이 몬스터 레벨보다 너무 낮지 않은 경우 else if (target.MyLevel <= Player.instance.MyLevel - 3 && target.MyLevel > XPManager.CalculateGrayLevel()) { levelText.color = Color.green; } //더 낮은경우 else { levelText.color = Color.grey; } }
// Start is called before the first frame update void Start() { switch (progressionType) { case XpTypes.Maps: boundary = XPManager.MAP_XP_BOUNDARIES; break; case XpTypes.Skins: boundary = XPManager.SKIN_XP_BOUNDARIES; break; } int level = XPManager.CalculateLevel(XPManager.GetStoredXP(), boundary); for (int i = 0; i < progression.Length; ++i) { progression[i].item.gameObject.SetActive(level >= i); if (progression[i].lockedPlaceholder != null) { progression[i].lockedPlaceholder.gameObject.SetActive(level < i); } } }
public Mushroom(Texture2D spriteSheet, Vector2 frameSize, Vector2 position, Level level, Yat yat, Fireball fireball, SoundEffectInstance sound, XPManager xpgen, Rectangle window) { this.animationSpeed = 10; this.spriteSheet = spriteSheet; this.frameSize = frameSize; this.Position = position; this.framesX = (int)(spriteSheet.Width / frameSize.X); this.framesY = (int)(spriteSheet.Height / frameSize.Y); this.level = level; this.yat = yat; this.fireball = fireball; this.sound = sound; this.xpgen = xpgen; this.Window = window; this.Visible = true; }
/// <summary> /// Adapte la couleur du niveau en fonction de celui du joueur /// </summary> /// <param name="target">Cible du joueur</param> private void SetColorLevelText(Enemy target) { // Adapte la couleur du niveau en fonction de celui du joueur if (target.MyLevel >= Player.MyInstance.MyLevel + 5) { levelText.color = Color.red; } else if (target.MyLevel == Player.MyInstance.MyLevel + 3 || target.MyLevel == Player.MyInstance.MyLevel + 4) { levelText.color = new Color32(255, 160, 0, 255); } else if (target.MyLevel >= Player.MyInstance.MyLevel - 2 && target.MyLevel <= Player.MyInstance.MyLevel + 2) { levelText.color = Color.yellow; } else if (target.MyLevel <= Player.MyInstance.MyLevel - 3 && target.MyLevel > XPManager.CalculateGrayLevel()) { levelText.color = Color.green; } else { levelText.color = Color.grey; } }
public override void OnInit(XPManager manager, int randomSeed) { base.OnInit(manager, randomSeed); Init((MAIAManager)manager); }
// Start is called before the first frame update void Start() { xpm_obj = GameObject.Find("XP Manager"); xpm = xpm_obj.GetComponent <XPManager>(); }