tesst skill

This commit is contained in:
VDH
2026-02-09 15:15:31 +07:00
parent 781c5cd08d
commit 8bce2d6b06
12 changed files with 1336 additions and 1122 deletions
@@ -125,7 +125,7 @@ MonoBehaviour:
Value: -268
Center: 20
Range: {x: -360, y: 360}
Wrap: 1
Wrap: 0
Recentering:
Enabled: 0
Wait: 1
@@ -21,6 +21,9 @@ namespace BrewMonster
void OnEnable()
{
Instance = this;
#if UNITY_EDITOR
speedX = 500;
#endif
}
public void OnDrag(PointerEventData eventData)
@@ -31,7 +34,7 @@ namespace BrewMonster
{
orbital.HorizontalAxis.Value += delta.normalized.x * speedX * Time.deltaTime;
//orbital.HorizontalAxis.Value = Mathf.Clamp(orbital.HorizontalAxis.Value, -360f, 360f);
orbital.VerticalAxis.Value += delta.normalized.y * speedY * Time.deltaTime;
orbital.VerticalAxis.Value -= delta.normalized.y * speedY * Time.deltaTime;
orbital.VerticalAxis.Value = Mathf.Clamp(orbital.VerticalAxis.Value, -360f, 360f);
}
currentPos = eventData.position;
@@ -297,7 +297,6 @@ namespace BrewMonster.Scripts
FinishWorkAtPriority(iPriority);
WorkList workList = m_WorkStack[iPriority];
workList.Add(pWork);
BMLogger.LogError("m_WorkStack " + pWork.GetWorkID());
if (shouldStart)
{
if (iPriority > m_iCurPriority)
@@ -23,7 +23,7 @@ namespace BrewMonster
OnMsgLBtnClick();
}
#if UNITY_EDITOR
if (Input.GetKeyDown(KeyCode.Space))
/* if (Input.GetKeyDown(KeyCode.Space))
{
isPressMoveUp = true;
OnMsgHstPushMove();
@@ -44,7 +44,7 @@ namespace BrewMonster
{
isPressMoveDown = false;
OnMsgHstPushMove();
}
}*/
if (Input.GetKeyDown(KeyCode.F4))
{
CmdFly(true);
@@ -57,6 +57,11 @@ namespace BrewMonster
{
OnCommandSummon(2);
}
if (Input.GetKeyDown(KeyCode.H))
{
BMLogger.LogError("Input.GetKeyDown(KeyCode.H)");
CycleSkillShortcuts();
}
#endif
}
@@ -1172,10 +1172,6 @@ public class CECNPC : CECObject
}
public void SetPos(Vector3 pos)
{
if (-2041570812 == m_NPCInfo.nid)
{
BMLogger.LogError("CECNPC::SetPos,else pos=" + pos);
}
transform.position = pos;
}
public void MoveTo(cmd_object_move Cmd)
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -77,7 +77,7 @@ namespace BrewMonster.Scripts.Skills
}
public override int GetRangeType() { return stub.GetRange().type; }
public override int GetRequiredLevel() { return stub.GetRequiredLevel(this); }
public override void GetIntroduction(StringBuilder buf, SkillStr table)
public override void GetIntroduction(StringBuilder buf, SkillStr table)
{
int n = stub.GetIntroduction(this, buf, table.Find((int)stub.id * 10 + 1));
}
@@ -107,7 +107,8 @@ namespace BrewMonster.Scripts.Skills
// 检查施放时hp条件 // Check HP condition when casting
public override bool CheckHpCondition(int hp, int max_hp) { return stub.CheckHpCondition(hp, max_hp); }
public override bool CheckComboSkExtraCondition() { return stub.CheckComboSkExtraCondition(this); }
public override byte GetAllowForms() { return stub.allow_forms; }
public override byte GetAllowForms() { return stub.allow_forms; }
public override int GetApCost() { return stub.apcost; }
public override string GetName() { return stub.GetName(); }
public override float GetPrayRange(float range, float prayplus)
@@ -23,7 +23,6 @@ namespace BrewMonster.UI
public virtual void Show(bool value)
{
BMLogger.LogError("AUIDialog::Show() not implemented i n gameObject.SetActive = " + value);
gameObject.SetActive(value);
m_bShow = value;
OnShowDialogue();
@@ -65,16 +65,12 @@ namespace BrewMonster
}*/
else if (pHost.IsSpellingMagic() && pCurSkill != null)
{
BMLogger.LogError("CDlgHost::RefreshIncantBar - IsSpellingMagic");
bShow = true;
CECCounter counter = pHost.GetIncantCnt();
nCur = counter.GetCounter();
nMax = Mathf.Max(counter.GetPeriod(), 1);
BMLogger.LogError($"CDlgHost::RefreshIncantBar - nCur=" + nCur + $"nMax={nMax} counter.GetPeriod()={counter.GetPeriod()} ");
pDlg.GetSkillNameText().text = (EC_Game.GetSkillDesc().GetWideString(pCurSkill.GetSkillID() * 10));
BMLogger.LogError("CDlgHost:: = (nCur / nMax)=" + (nCur / nMax));
BMLogger.LogError("CDlgHost::bShow =" + bShow);
}
/* else if (pHost.IsCongregating())
{
@@ -93,7 +89,6 @@ namespace BrewMonster
{
if (!pDlg.IsShow())
{
BMLogger.LogError("CDlgHost::bShowbShow");
pDlg.Show(true);
}
pDlg.GetProgressImage().fillAmount = (nCur / nMax);
@@ -103,7 +98,6 @@ namespace BrewMonster
if (pDlg.IsShow())
{
pDlg.Show(false);
BMLogger.LogError("CDlgHost::bShowbShow not");
}
}
+146 -3
View File
@@ -71,6 +71,11 @@ namespace BrewMonster
private List<CECSkill> m_aEquipSkills = new List<CECSkill>();
private List<CECSkill> m_aGoblinSkills = new List<CECSkill>();
#if UNITY_EDITOR
[SerializeField] private int m_startingSkillID = 0; // Starting skill ID for H key shortcut (0 = use cycling, >0 = use specific ID)
private int m_currentSkillCycleIndex = 0;
#endif
private bool m_bEnterGame;
public CECSkill m_pPrepSkill;
private float playerSpeed = 5.0f;
@@ -106,7 +111,7 @@ namespace BrewMonster
bool m_bUsingTrashBox = false; // Whether being using trash box
private float m_fPrayDistancePlus;
private A3DVECTOR3 g_vOrigin = new A3DVECTOR3(0f);
private float EC_SLOPE_Y = 0.5f;
int m_iOldWalkMode = Move_Mode.MOVE_STAND; // Copy of work mode
public uint m_dwMoveRelDir = 0; // Move relative direction flags
@@ -1750,6 +1755,144 @@ namespace BrewMonster
}
}
}
#if UNITY_EDITOR
/// <summary>
/// Cycles through learned skills by removing all shortcuts and adding 2 new skills to slots 0 and 1.
/// If m_startingSkillID is set (>0), uses that specific skill ID and the next one (ID+1).
/// Otherwise, cycles through all learned skills in pairs.
/// </summary>
public void CycleSkillShortcuts()
{
// Get shortcut set 1
CECShortcutSet pSCS = GetShortcutSet1(0);
if (pSCS == null)
{
Debug.LogWarning("CycleSkillShortcuts: Shortcut Set 1 is null");
return;
}
// Remove all shortcuts
pSCS.RemoveAllShortcuts();
// If starting skill ID is configured, cycle through pairs starting from that ID
if (m_startingSkillID > 0)
{
// Calculate the current skill IDs based on cycle index
// First press: startingID + 0, startingID + 1 (e.g., 5, 6)
// Second press: startingID + 2, startingID + 3 (e.g., 7, 8)
// Third press: startingID + 4, startingID + 5 (e.g., 9, 10)
int currentSkillID1 = m_startingSkillID + (m_currentSkillCycleIndex * 2);
int currentSkillID2 = currentSkillID1 + 1;
BMLogger.LogError($"CycleSkillShortcuts: Trying to add skills {currentSkillID1} and {currentSkillID2}");
// Find and add first skill
CECSkill pSkill1 = GetPositiveSkillByID(currentSkillID1);
if (pSkill1 != null)
{
pSCS.CreateSkillShortcut(0, pSkill1);
Debug.LogError($"CycleSkillShortcuts: Added skill ID {currentSkillID1} to slot 0");
}
else
{
Debug.LogError($"CycleSkillShortcuts: Skill with ID {currentSkillID1} not found in learned skills");
int find = 1;
while (pSkill1 == null || find == 100)
{
m_startingSkillID++;
Debug.LogError($"CycleSkillShortcuts: m_startingSkillID {m_startingSkillID} ");
currentSkillID1 = m_startingSkillID + (m_currentSkillCycleIndex * 2);
pSkill1 = GetPositiveSkillByID(currentSkillID1);
find++;
}
pSCS.CreateSkillShortcut(0, pSkill1);
}
// Find and add second skill
CECSkill pSkill2 = GetPositiveSkillByID(currentSkillID2);
if (pSkill2 != null)
{
pSCS.CreateSkillShortcut(1, pSkill2);
Debug.LogError($"CycleSkillShortcuts: Added skill ID {currentSkillID2} to slot 1");
}
else
{
Debug.LogError($"CycleSkillShortcuts: Skill with ID {currentSkillID2} not found in learned skills");
int find = 1;
while (pSkill2 == null || find == 100)
{
m_startingSkillID++;
Debug.LogError($"CycleSkillShortcuts: m_startingSkillID {m_startingSkillID} ");
currentSkillID2 = m_startingSkillID + (m_currentSkillCycleIndex * 2) +1;
pSkill2 = GetPositiveSkillByID(currentSkillID2);
find++;
}
pSCS.CreateSkillShortcut(1, pSkill2);
}
// Increment cycle index for next press
m_currentSkillCycleIndex++;
// Update UI
CDlgQuickBar cDlgQuickBar2 = CECUIManager.Instance?.GetCDlgQuickBar();
cDlgQuickBar2?.UpdateShortcuts();
return;
}
// Original cycling behavior
// Get the list of learned skills
int skillCount = GetPositiveSkillNum();
// If no skills learned, just clear shortcuts (already done above)
if (skillCount == 0)
{
// Update UI
CDlgQuickBar cDlgQuickBar1 = CECUIManager.Instance?.GetCDlgQuickBar();
cDlgQuickBar1?.UpdateShortcuts();
return;
}
// Calculate how many pairs we can make
int maxPairs = (skillCount + 1) / 2; // Round up division
// Wrap around if we've reached the end
if (m_currentSkillCycleIndex >= maxPairs)
{
m_currentSkillCycleIndex = 0;
}
// Calculate skill indices for this cycle
int skillIndex1 = m_currentSkillCycleIndex * 2;
int skillIndex2 = skillIndex1 + 1;
// Add first skill to slot 0
if (skillIndex1 < skillCount)
{
CECSkill pSkill1 = GetPositiveSkillByIndex(skillIndex1);
if (pSkill1 != null)
{
pSCS.CreateSkillShortcut(0, pSkill1);
}
}
// Add second skill to slot 1 (if available)
if (skillIndex2 < skillCount)
{
CECSkill pSkill2 = GetPositiveSkillByIndex(skillIndex2);
if (pSkill2 != null)
{
pSCS.CreateSkillShortcut(1, pSkill2);
}
}
// Increment cycle index for next time
m_currentSkillCycleIndex++;
// Update UI
CDlgQuickBar cDlgQuickBar = CECUIManager.Instance?.GetCDlgQuickBar();
cDlgQuickBar?.UpdateShortcuts();
}
#endif
public bool HostIsReady()
{
return m_bEnterGame;
@@ -4834,7 +4977,7 @@ namespace BrewMonster
if (pSkill.SkillCore != null)
{
return pSkill.SkillCore.Condition((uint)pSkill.GetSkillID(),Info, pSkill.GetSkillLevel());
return pSkill.SkillCore.Condition((uint)pSkill.GetSkillID(), Info, pSkill.GetSkillLevel());
}
return 0; // Success
@@ -6073,7 +6216,7 @@ namespace BrewMonster
// Is spelling magic
public bool IsSpellingMagic()
{
if(m_pWorkMan == null) return false;
if (m_pWorkMan == null) return false;
return m_pWorkMan.IsSpellingMagic();
}
+22
View File
@@ -125,6 +125,28 @@ public class CECUIManager : MonoSingleton<CECUIManager>
}
return null;
}
public CDlgMessageBox ShowMessageBox(string title, string message, MessageBoxType messageBoxType, Action onClickedYes = null, Action onClickedNo = null)
{
var msgBox = GetInGameUIMan().GetDialog("DlgMessageBox") as CDlgMessageBox;
if (msgBox != null)
{
msgBox.ShowMessageBox(new MessageBoxData()
{
Title = title,
Message = message,
MessageBoxType = messageBoxType,
OnClickedYes = onClickedYes,
OnClickedNo = onClickedNo
});
return msgBox;
}
else
{
Debug.LogError("DlgMessageBox not found in InGameUIMan");
}
return null;
}
public void UpdateSkillRelatedUI()
{
// ¸üм¼ÄÜÏà¹ØµÄ½çÃæÏÔʾ
File diff suppressed because one or more lines are too long