コード例 #1
0
 private static void Print(TextObject message, CombatLogColor logColor = CombatLogColor.White)
 {
     Debug.DebugColor color = (Debug.DebugColor)logColor;
     Debug.Print(message.ToString(), color: color, debugFilter: 562949953421312UL);
 }
コード例 #2
0
        public static void PrintDebugLogForInfo(
            Agent attackerAgent,
            Agent victimAgent,
            DamageTypes damageType,
            int speedBonus,
            int armorAmount,
            int inflictedDamage,
            int absorbedByArmor,
            sbyte collisionBone,
            float lostHpPercentage)
        {
            TextObject     message  = TextObject.Empty;
            CombatLogColor logColor = CombatLogColor.White;
            bool           isMine   = attackerAgent.IsMine;
            int            num      = victimAgent.IsMine ? 1 : 0;

            GameTexts.SetVariable("AMOUNT", inflictedDamage);
            GameTexts.SetVariable("DAMAGE_TYPE", damageType.ToString().ToLower());
            GameTexts.SetVariable("LOST_HP_PERCENTAGE", lostHpPercentage);
            if (num != 0)
            {
                GameTexts.SetVariable("ATTACKER_NAME", attackerAgent.Name);
                message  = GameTexts.FindText("combat_log_player_attacked");
                logColor = CombatLogColor.Red;
            }
            else if (isMine)
            {
                GameTexts.SetVariable("VICTIM_NAME", victimAgent.Name);
                message  = GameTexts.FindText("combat_log_player_attacker");
                logColor = CombatLogColor.Green;
            }
            CombatLogManager.Print(message, logColor);
            MBStringBuilder mbStringBuilder = new MBStringBuilder();

            mbStringBuilder.Initialize(callerMemberName: nameof(PrintDebugLogForInfo));
            if (armorAmount > 0)
            {
                GameTexts.SetVariable("ABSORBED_AMOUNT", absorbedByArmor);
                GameTexts.SetVariable("ARMOR_AMOUNT", armorAmount);
                mbStringBuilder.AppendLine <string>(GameTexts.FindText("combat_log_damage_absorbed").ToString());
            }
            if (victimAgent.IsHuman)
            {
                Agent.AgentBoneMapArray boneMappingArray = victimAgent.BoneMappingArray;
                for (int index = 0; index < boneMappingArray.Length; ++index)
                {
                    HumanBone i = (HumanBone)index;
                    if ((int)collisionBone == (int)boneMappingArray[i])
                    {
                        GameTexts.SetVariable("BONE", i.ToString());
                        mbStringBuilder.AppendLine <string>(GameTexts.FindText("combat_log_hit_bone").ToString());
                        break;
                    }
                }
            }
            if (speedBonus != 0)
            {
                GameTexts.SetVariable("SPEED_BONUS", speedBonus);
                mbStringBuilder.AppendLine <string>(GameTexts.FindText("combat_log_speed_bonus").ToString());
            }
            CombatLogManager.Print(new TextObject(mbStringBuilder.ToStringAndRelease()));
        }