Exemple #1
0
        public void DisplayHitDamage(CombatEntity victim, CombatEntity attacker, DamageInfo damageInfo, float dmg, bool hasBombBraEffect)
        {
            if (!data.displayDamageOnHit || victim.CharacterSprite == null || dmg <= 0f)
            {
                return;
            }

            float ratio = 0.5f;

            if (attacker != null)
            {
                RCG.Player player = attacker as RCG.Player;
                if (player != null)
                {
                    PlayerCharacters pc = PlayerManager.Instance.Players[player.PlayerID].ClassNameToPlayerCharacter;
                    if (hasBombBraEffect)
                    {
                        ratio = 1f;
                    }

                    int current = damageInfo.DamageAmount;
                    int min     = current;
                    int max     = current;
                    for (int i = 0; i < player.CharacterDescription.MovesList.Count; i++)
                    {
                        int baseDmg = player.CharacterDescription.MovesList[i].DamageInfo.DamageAmount;

                        if (baseDmg <= 0)
                        {
                            continue;
                        }

                        if (min > baseDmg)
                        {
                            min = baseDmg;
                        }
                        if (max < baseDmg)
                        {
                            max = baseDmg;
                        }
                    }
                    ratio = Mathf.InverseLerp((float)min, (float)max, (float)current);
                }
                else
                {
                    ratio = Mathf.InverseLerp(0.05f, 0.4f, Mathf.CeilToInt(dmg) / (float)(victim.Stamina + Mathf.CeilToInt(dmg)));
                }
            }
            int scaledFontSize = Mathf.RoundToInt(Mathf.Lerp(data.hitDmgTextFontSizeMin, data.hitDmgTextFontSizeMax, ratio));

            DisplayCustomTextAbove(victim, string.Format("{0}{1}", Mathf.CeilToInt(dmg), hasBombBraEffect ? "!" : ""), true, data.hitDmgTextColor, scaledFontSize);
        }
Exemple #2
0
 public static void TryHeavyAttackGuardBreak(RCG.Player player, CombatEntity combatEntity)
 {
     if (player != null && !(combatEntity is BossBaseEntity))
     {
         string playerMoveName = player.CurrentMove.MoveName;
         if (playerMoveName == "MisakoHaymaker" ||
             playerMoveName == "KyokoDab" ||
             playerMoveName == "RikiOneInchPunch" ||
             playerMoveName == "KunioEat")
         {
             combatEntity.Fsm.ChangeState <EnemyBlockPushedByPlayer>(100);
             player.ChangeState <PlayerIdle>(100);
         }
     }
 }
Exemple #3
0
 public static bool TryBackAttackAutoParry(RCG.Player player, CombatEntity combatEntity)
 {
     if (player != null)
     {
         string playerMoveName = player.CurrentMove.MoveName;
         if (playerMoveName == "MisakoBruceBackhand" ||
             playerMoveName == "KyokoDonkeyKick" ||
             playerMoveName == "RikiCombingHair" ||
             playerMoveName == "KunioBackElbow")
         {
             if ((combatEntity.transform.position.x > player.transform.position.x) != (player.Facing.FacingSign > 0))
             {
                 combatEntity.Fsm.ChangeState <EnemyBlockPushedByPlayer>(100);
                 player.Facing.SetFacingFromSign(player.Facing.FacingSign * -1);
                 player.PlayVFX_Parry();
                 player.ChangeState <PlayerIdle>(100);
             }
             return(true);
         }
     }
     return(false);
 }