Files
Continentis/Assets/Mods/Basic/Rules/Basic_AttributeRulesCollection.cs

50 lines
2.9 KiB
C#
Raw Normal View History

2025-10-03 00:02:43 -04:00
using System.Collections.Generic;
using Continentis.MainGame.Rules;
2025-10-23 00:49:44 -04:00
using SLSFramework.General;
2025-10-03 00:02:43 -04:00
using UnityEngine;
namespace Continentis.Mods.Basic.Rules
{
public class Basic_AttributeRulesCollection : AttributeRulesCollectionBase
{
public override void ApplyRules_ConvertCoreIntoGeneral(Dictionary<string, float> core, Dictionary<string, float> general)
{
2025-11-15 09:08:36 -05:00
if (core.TryGetValue("DisableConversion", out float value) && value > 0) //如果禁用属性转换,则直接返回
{
return;
}
2025-10-30 04:21:28 -04:00
float level = core["Level"];
2025-12-11 17:25:49 -05:00
//general["MaximumHealth"] += Mathf.FloorToInt(level * 3);
//general["MaximumMana"] += Mathf.FloorToInt(level / 2);
2025-10-30 04:21:28 -04:00
2025-10-03 00:02:43 -04:00
float strengthOffset = core["Strength"] - 12;
general["MaximumStamina"] += Mathf.FloorToInt(strengthOffset / 4); //最大行动点加成
2025-10-23 00:49:44 -04:00
general["OffsetFromStrength"] += Mathf.FloorToInt(strengthOffset / 3); //来自核心属性(力量)的调整值
2025-10-03 00:02:43 -04:00
float agilityOffset = core["Agility"] - 12;
general["Speed"] += Mathf.FloorToInt(agilityOffset); //速度加成
2025-10-23 00:49:44 -04:00
general["OffsetFromAgility"] += Mathf.FloorToInt(agilityOffset / 3); //来自核心属性(敏捷)的调整值
2025-10-03 00:02:43 -04:00
float intelligenceOffset = core["Intelligence"] - 12;
general["DeckCapacity"] += intelligenceOffset;
2025-10-23 00:49:44 -04:00
general["OffsetFromIntelligence"] += Mathf.FloorToInt(intelligenceOffset / 3); //来自核心属性(智力)的调整值
2025-10-03 00:02:43 -04:00
general["ManaRecoverPerAction"] += Mathf.FloorToInt(intelligenceOffset / 6); //每回合恢复魔法值
float physiqueOffset = core["Physique"] - 12;
general["MaximumHealth"] += core["Physique"] * 6; //最大生命值加成
2025-12-11 17:25:49 -05:00
Debug.Log("Physique Offset: " + physiqueOffset);
2025-10-03 00:02:43 -04:00
general["StaminaRecoverPerAction"] += Mathf.FloorToInt(physiqueOffset / 6); //每回合恢复行动点
2025-10-23 00:49:44 -04:00
general["OffsetFromPhysique"] += Mathf.FloorToInt(physiqueOffset / 3); //来自核心属性(体质)的调整值
2025-10-03 00:02:43 -04:00
float perceptionOffset = core["Perception"] - 12;
general["DrawCardAmountPerAction"] += Mathf.FloorToInt(perceptionOffset / 6); //来自核心属性(感知)的每回合额外抽牌数量
2025-12-11 17:25:49 -05:00
general["DrawCardAmountPerAction"] += 10; //TODO: 临时的,后续会移除
2025-10-23 00:49:44 -04:00
general["Awareness"] += perceptionOffset; //增加感知
general["OffsetFromPerception"] += Mathf.FloorToInt(perceptionOffset / 3); //来自核心属性(感知)的调整值
2025-10-03 00:02:43 -04:00
float charismaOffset = core["Charisma"] - 12;
2025-10-23 00:49:44 -04:00
general["OffsetFromCharisma"] += Mathf.FloorToInt(charismaOffset / 3); //来自核心属性(魅力)的调整值
2025-10-03 00:02:43 -04:00
}
}
}