예제 #1
0
        /// <summary>
        /// Gets the skill effect flags for the specified magic effects.
        /// </summary>
        /// <param name="visibleEffects">The visible effects.</param>
        /// <returns>The skill effect flags.</returns>
        internal static SkillEffects GetSkillFlags(this IList <MagicEffect> visibleEffects)
        {
            SkillEffects effectFlags = SkillEffects.Undefined;

            foreach (var visibleEffect in visibleEffects)
            {
                switch (visibleEffect.Id)
                {
                case 0x01:
                    effectFlags |= SkillEffects.DamageBuff;
                    break;

                case 0x02:
                    effectFlags |= SkillEffects.DefenseBuff;
                    break;

                case 0x37:
                    effectFlags |= SkillEffects.Poisoned;
                    break;

                case 0x38:
                    effectFlags |= SkillEffects.Iced;
                    break;

                default:
                    // others are not supported, so we ignore them.
                    break;
                }
            }

            return(effectFlags);
        }
예제 #2
0
    IEnumerator RunSkillEffects(SkillEffects effects, TerasCalcs source, TerasCalcs target, SkillTarget targetedAt)
    {
        // stat boosting
        if (effects.Boosts != null)
        {
            if (targetedAt == SkillTarget.self)
            {
                source.ApplyBoost(effects.Boosts);
            }
            else
            {
                target.ApplyBoost(effects.Boosts);
            }
        }
        //Status condition
        if (effects.Status != ConditionID.none)
        {
            target.SetStatus(effects.Status);
        }

        //Volotile status condition
        if (effects.VolotileStatus != ConditionID.none)
        {
            target.SetVolotileStatus(effects.VolotileStatus);
        }

        yield return(ShowStatusChanges(source));

        yield return(ShowStatusChanges(target));
    }
예제 #3
0
 public void SendSkillEffect(uint addition, SkillEffects effect, uint amount)
 {
     Packets.Server.SkillEffect p = new SagaMap.Packets.Server.SkillEffect();
     p.SetActorID(this.Char.id);
     p.SetU1(1);
     p.SetU2(addition);
     p.SetFunction((byte)effect);
     p.SetAmount(amount);
     this.netIO.SendPacket(p, this.SessionID);
 }
예제 #4
0
 private void Awake()
 {
     skillEffects = GetComponent <SkillEffects>();
     pt           = skillEffects.GetType();
     eaEffects    = GetComponent <EnemyAttackEffects>();
     et           = eaEffects.GetType();
     playerStats.GetStats();
     for (int i = 0; i < playerStats.statArray.Length; i++)
     {
         battleInfo.oldStats[i] = playerStats.statArray[i];
     }
 }
예제 #5
0
    protected override void Initialized()
    {
        _skillEffects = new SkillEffects(game);
        _cardInteractionTranslator = SceneTrackersFinder.Instance.GetSceneTracker <AirConsoleMessageST>().Get <CardInteractionTranslator>();
        _coinTranslator            = SceneTrackersFinder.Instance.GetSceneTracker <AirConsoleMessageST>().Get <CoinTranslator>();
        _skillTranslator           = SceneTrackersFinder.Instance.GetSceneTracker <AirConsoleMessageST>().Get <SkillTranslator>();

        _conPlayer = Ramses.Confactory.ConfactoryFinder.Instance.Get <ConPlayers>();

        for (int i = 0; i < game.GamePlayers.Length; i++)
        {
            game.GamePlayers[i].ReceivedCardEvent += OnReceivedCardEvent;
        }
    }
예제 #6
0
    public SkillEffects GetEffects(bool is_burst = false)
    {
        SkillEffects effects = new SkillEffects();

        effects.deals_damage = deals_damage;
        float tmp_damages = (float)PlayerBattle.instance.GetEffectiveBattleElementAffinity(element) * damage_ratio;

        effects.damages = Mathf.CeilToInt(tmp_damages);
        if (is_burst == true)
        {
            effects.damages *= 2;
        }
        Debug.LogWarning("name: " + skill_name + "damage_ratio: " + damage_ratio + ", tmp: " + tmp_damages + "total: " + effects.damages);    //toto
        effects.skill = this;
        return(effects);
    }
예제 #7
0
파일: Skill.cs 프로젝트: ntntn/MyRpg
    protected SkillEffect GetSkillEffectByType(SkillEffects e)
    {
        SkillEffect effect = default;;

        switch (e.skillEffectType)
        {
        case SkillEffectType.ChangeHealth:
            effect = e.changeHealth;
            break;

        case SkillEffectType.ChangeHealthOverTime:
            effect = e.changeHealthOverTime;
            break;

        case SkillEffectType.Frozen:
            effect = e.frozen;
            break;

        default:
            break;
        }

        return(effect);
    }
예제 #8
0
 public void SendSkillEffect(uint addition, SkillEffects effect, uint amount)
 {
     Packets.Server.SkillEffect p = new SagaMap.Packets.Server.SkillEffect();
     p.SetActorID(this.Char.id);
     p.SetU1(1);
     p.SetU2(addition);
     p.SetFunction((byte)effect);
     p.SetAmount(amount);
     this.netIO.SendPacket(p, this.SessionID);
 }
예제 #9
0
    IEnumerator Coroutine_SkillEffects(Skill skill, bool is_burst = false)
    {
        ParticleSystem attack_FX = attacks_FX[(int)skill.element];

        Debug.LogWarning("is_burst = " + is_burst);
        is_casting_skill = false;
        casted_skill     = null;

        StartCoroutine(Coroutine_AttackFX(attack_FX, is_burst));
        if (is_burst == true)
        {
            yield return(new WaitForSeconds(0.5f + BattleManager.instance.extra_time_for_burst_attack));

            attack_FX.startLifetime -= BattleManager.instance.life_time_delta_for_burst_attack;
            attack_FX.startSpeed    -= BattleManager.instance.speed_delta_for_burst_attack;
            attack_FX.startSize     -= BattleManager.instance.extra_size_for_burst_attack;
        }
        else
        {
            bonus_affinity_to_be_added_next = Mathf.CeilToInt(((float)GetEffectiveBattleElementAffinity(skill.element)) * skill.combos_bonus_affinity_ratio);
            yield return(new WaitForSeconds(0.5f));
        }



        SkillEffects skill_effects = skill.GetEffects(is_burst);

        last_skill_effect_applied = skill_effects;
        if (is_burst == true)
        {
            bonus_affinity_to_be_added_next = 0;
            ResetAffinities();
            Player.instance.base_element_affinities[(int)skill.element] += 1;
        }
        if (skill_effects.deals_damage)
        {
            if (BattleManager.instance.enemy_has_element == true)
            {
                ElementRelation element_relation = ElementManager.instance.GetRelationBetween(
                    skill.element, BattleManager.instance.enemy_current_element
                    );
                int current_boss_affinity = BattleManager.instance.GetEnemyCurrentElementAffinity();
                switch (element_relation)
                {
                case ElementRelation.NORMAL:
                    SoundManager.instance.PlayIndependant(SoundManager.instance.normal_damage_sound);
                    StartCoroutine(SpecialEffectsManager.instance.normal_damage_shake.LaunchShake(BattleManager.instance.enemy_moster.visuals_transform));
                    BattleManager.instance.EnemyTakeDamage(Mathf.Max(0, skill_effects.damages - current_boss_affinity));
                    break;

                case ElementRelation.STRONG:
                    SoundManager.instance.PlayIndependant(SoundManager.instance.strong_damage_sound);
                    StartCoroutine(SpecialEffectsManager.instance.critical_damage_shake.LaunchShake(BattleManager.instance.enemy_moster.visuals_transform));
                    BattleManager.instance.EnemyTakeDamage((skill_effects.damages * 2) + current_boss_affinity);
                    break;

                case ElementRelation.WEAK:
                    SoundManager.instance.PlayIndependant(SoundManager.instance.weak_damage_sound);
                    BattleManager.instance.enemy_moster.moster_data.moster_battle.generic_animator.SetTrigger("StayStill");
                    BattleManager.instance.EnemyTakeDamage(Mathf.Max(0, (skill_effects.damages / 2) - current_boss_affinity));
                    break;
                }
                Debug.LogWarning("element_relation:" + element_relation + ", enemy affinity: " + current_boss_affinity);
            }
            else
            {
                SoundManager.instance.PlayIndependant(SoundManager.instance.normal_damage_sound);
                StartCoroutine(SpecialEffectsManager.instance.normal_damage_shake.LaunchShake(BattleManager.instance.enemy_moster.visuals_transform));
                BattleManager.instance.EnemyTakeDamage(skill_effects.damages);
            }
            Debug.LogWarning("skill_effect: base_damage:" + skill_effects.damages);
            Debug.LogWarning("new_boss_life: " + BattleManager.instance.enemy_current_life);
        }


        if (BattleManager.instance.CheckEnemyDeath() == false)
        {
            Player.instance.CheckDeath();
        }
        skill_ended = true;
        yield return(new WaitForSeconds(0.001f));
    }
예제 #10
0
    void UpdateHack()
    {
        if (Input.GetKeyDown(KeyCode.KeypadPlus))
        {
            Time.timeScale *= 2;
        }
        if (Input.GetKeyDown(KeyCode.KeypadMinus))
        {
            Time.timeScale /= 2;
        }
        if (Input.GetKeyDown(KeyCode.End))
        {
            Application.LoadLevel(Application.loadedLevel);
            Time.timeScale = 1;
        }
        if (Input.GetKey(KeyCode.LeftShift))
        {
            if (Input.GetKeyDown(KeyCode.L))
            {
                quick_screens = !quick_screens;
            }
            if (Input.GetKeyDown(KeyCode.P))
            {
                Debug.LogWarning("Player loose collision !");
                PlayerExploration.instance.hitboxes_transform.gameObject.SetActive(!PlayerExploration.instance.hitboxes_transform.gameObject.activeSelf);
            }
            if (Input.GetKeyDown(KeyCode.U))
            {
                Debug.LogWarning("states!");
                foreach (var s in StateManager.instance.current_states)
                {
                    Debug.LogWarning(s);
                }
            }

            if (Input.GetKeyDown(KeyCode.A))
            {
                Debug.LogWarning("TEST skill effect");
                tested_skill_effects = skill_to_test.GetEffects();
            }
            if (Input.GetKeyDown(KeyCode.Z))
            {
                Debug.LogWarning("TEST click on skill");
                PlayerBattle.instance.ClickOnSkill(skill_to_test);
            }
            if (Input.GetKeyDown(KeyCode.E))
            {
                Debug.LogWarning("TEST start battle");
                BattleManager.instance.StartBattle(enemy_moster_to_test);
            }
            if (Input.GetKeyDown(KeyCode.R))
            {
                Debug.LogWarning("TEST END battle");
                BattleManager.instance.EndBattle();
            }

            if (Input.GetKeyDown(KeyCode.D))
            {
                Debug.LogWarning("TEST player evolving to: " + player_moster_to_evolve_test.moster_name);
                Player.instance.EvolveTo(player_moster_to_evolve_test);
            }
            if (Input.GetKeyDown(KeyCode.F))
            {
                Debug.LogWarning("TEST player speed up");
                PlayerExploration.instance.move_speed *= 1.5f;
            }
            if (Input.GetKeyDown(KeyCode.Q))
            {
                Debug.LogWarning("TEST click on change element: " + battle_selected_element_for_defense);
                PlayerBattle.instance.ClickOnElementDefense(battle_selected_element_for_defense);
            }
            if (Input.GetKeyDown(KeyCode.W))
            {
                Debug.LogWarning("Use karma on life");
                Player.instance.UseKarmaForLife();
            }
            if (Input.GetKeyDown(KeyCode.X))
            {
                Debug.LogWarning("Use karma on shield");
                Player.instance.UseKarmaForShield();
            }
            if (Input.GetKeyDown(KeyCode.C))
            {
                Debug.LogWarning("Use karma on element affinity: " + karma_boost_element_selected);
                Player.instance.UseKarmaForElementAffinity(karma_boost_element_selected);
            }
            if (Input.GetKeyDown(KeyCode.K))
            {
                Debug.LogWarning("Gain Karma ");
                Player.instance.current_karma += 1;
            }
        }
        if (Input.GetKeyDown(KeyCode.B))
        {
            Debug.LogWarning("TEST BURST");
            PlayerBattle.instance.BurstAffinities();
        }
        if (Input.GetKeyDown(KeyCode.N))
        {
            Debug.LogWarning("TEST RESET");
            PlayerBattle.instance.ResetAffinities();
        }
        if (Input.GetKeyDown(KeyCode.Space))
        {
            Debug.LogWarning("TEST CANCEL COMBOS");
            PlayerBattle.instance.CancelCombos();
        }
        if (Input.GetKey(KeyCode.RightShift))
        {
            if (Input.GetKeyDown(KeyCode.A))
            {
                CameraManager.instance.SetColorToFadePlane(Color.red);
                StartCoroutine(CameraManager.instance.COROUTINE_MainCameraFadeToTransparent());
            }
            if (Input.GetKeyDown(KeyCode.Z))
            {
                CameraManager.instance.SetColorToFadePlane(Color.blue);
                StartCoroutine(CameraManager.instance.COROUTINE_MainCameraFadeToOpaque(3f));
            }
            if (Input.GetKeyDown(KeyCode.D))
            {
                Debug.LogWarning("TEST: player death");
                Player.instance.LaunchDeath();
            }
            if (Input.GetKeyDown(KeyCode.S))
            {
                Debug.LogWarning("TEST: player teleport");
                Player.instance.LaunchBackToBase();
            }
        }

        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.F1))
        {
            GameManager.instance.SetSaveDataFromGame();
        }
        else if (Input.GetKeyDown(KeyCode.F1))
        {
            SaveManager.instance.LaunchSave();
        }

        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.F2))
        {
            GameManager.instance.SetSaveDataFromGame();
        }
        else if (Input.GetKeyDown(KeyCode.F2))
        {
            SaveManager.instance.LaunchLoad();
        }
        if (Input.GetKeyDown(KeyCode.F3))
        {
            Debug.LogWarning("Save reset !!");
            SaveManager.instance.save_data = SaveManager.instance.GetNewSaveData();
            SaveManager.instance.LaunchSave();
        }

        if (Input.GetKeyDown(KeyCode.F11))
        {
            Debug.LogWarning("SAVING GAME");
            GameManager.instance.SaveGame();
        }
        if (Input.GetKeyDown(KeyCode.F12))
        {
            Debug.LogWarning("LOADING GAME");
            GameManager.instance.LoadGame();
        }
    }
예제 #11
0
        public SkillEffect GetEffect(byte skillLevel)
        {
            SkillEffect ret;

            return(SkillEffects.TryGetValue(skillLevel, out ret) ? ret : null);
        }