Files
Continentis/Assets/Mods/Basic/Rules/Basic_AttributeRulesCollection.cs
SoulliesOfficial d09b58fd80 架构大更
2026-03-20 11:56:50 -04:00

50 lines
2.9 KiB
C#

using System.Collections.Generic;
using Continentis.MainGame.Rules;
using SLSFramework.General;
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)
{
if (core.TryGetValue("DisableConversion", out float value) && value > 0) //如果禁用属性转换,则直接返回
{
return;
}
float level = core["Level"];
//general["MaximumHealth"] += Mathf.FloorToInt(level * 3);
//general["MaximumMana"] += Mathf.FloorToInt(level / 2);
float strengthOffset = core["Strength"] - 12;
general["MaximumStamina"] += Mathf.FloorToInt(strengthOffset / 4); //最大行动点加成
general["OffsetFromStrength"] += Mathf.FloorToInt(strengthOffset / 3); //来自核心属性(力量)的调整值
float agilityOffset = core["Agility"] - 12;
general["Speed"] += Mathf.FloorToInt(agilityOffset); //速度加成
general["OffsetFromAgility"] += Mathf.FloorToInt(agilityOffset / 3); //来自核心属性(敏捷)的调整值
float intelligenceOffset = core["Intelligence"] - 12;
general["DeckCapacity"] += intelligenceOffset;
general["OffsetFromIntelligence"] += Mathf.FloorToInt(intelligenceOffset / 3); //来自核心属性(智力)的调整值
general["ManaRecoverPerAction"] += Mathf.FloorToInt(intelligenceOffset / 6); //每回合恢复魔法值
float physiqueOffset = core["Physique"] - 12;
general["MaximumHealth"] += core["Physique"] * 6; //最大生命值加成
Debug.Log("Physique Offset: " + physiqueOffset);
general["StaminaRecoverPerAction"] += Mathf.FloorToInt(physiqueOffset / 6); //每回合恢复行动点
general["OffsetFromPhysique"] += Mathf.FloorToInt(physiqueOffset / 3); //来自核心属性(体质)的调整值
float perceptionOffset = core["Perception"] - 12;
general["DrawCardAmountPerAction"] += Mathf.FloorToInt(perceptionOffset / 6); //来自核心属性(感知)的每回合额外抽牌数量
// TODO: 临时的测试加成已被移除,由角色默认属性或装备决定初始抽牌数
general["Awareness"] += perceptionOffset; //增加感知
general["OffsetFromPerception"] += Mathf.FloorToInt(perceptionOffset / 3); //来自核心属性(感知)的调整值
float charismaOffset = core["Charisma"] - 12;
general["OffsetFromCharisma"] += Mathf.FloorToInt(charismaOffset / 3); //来自核心属性(魅力)的调整值
}
}
}