@musashishao/agent-kit 1.9.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/.agent/agents/ai-asset-factory.md +700 -0
  2. package/.agent/agents/ai-audio-factory.md +503 -0
  3. package/.agent/agents/game-developer.md +4 -4
  4. package/.agent/agents/orchestrator.md +113 -3
  5. package/.agent/agents/project-planner.md +67 -0
  6. package/.agent/agents/unity-mobile-master.md +949 -0
  7. package/.agent/mcp/config/registry.json +65 -51
  8. package/.agent/mcp/servers/notebooklm/README.md +114 -0
  9. package/.agent/mcp/servers/notebooklm/package.json +35 -0
  10. package/.agent/mcp/servers/notebooklm/src/auth/chrome.ts +225 -0
  11. package/.agent/mcp/servers/notebooklm/src/auth/index.ts +1 -0
  12. package/.agent/mcp/servers/notebooklm/src/index.ts +516 -0
  13. package/.agent/mcp/servers/notebooklm/src/services/index.ts +3 -0
  14. package/.agent/mcp/servers/notebooklm/src/services/library.ts +217 -0
  15. package/.agent/mcp/servers/notebooklm/src/services/notebooklm.ts +380 -0
  16. package/.agent/mcp/servers/notebooklm/tsconfig.json +15 -0
  17. package/.agent/mcp-gateway/README.md +169 -20
  18. package/.agent/mcp-gateway/package.json +22 -7
  19. package/.agent/mcp-gateway/src/auth/index.ts +55 -0
  20. package/.agent/mcp-gateway/src/auth/middleware.ts +242 -0
  21. package/.agent/mcp-gateway/src/auth/oauth.ts +462 -0
  22. package/.agent/mcp-gateway/src/auth/scopes.ts +227 -0
  23. package/.agent/mcp-gateway/src/index.ts +252 -105
  24. package/.agent/mcp-gateway/src/observability/index.ts +5 -0
  25. package/.agent/mcp-gateway/src/observability/otel.ts +405 -0
  26. package/.agent/mcp-gateway/src/transports/index.ts +5 -0
  27. package/.agent/mcp-gateway/src/transports/streamableHttp.ts +235 -0
  28. package/.agent/rules/CODEX.md +89 -0
  29. package/.agent/rules/CODE_RULES.md +73 -0
  30. package/.agent/rules/GEMINI.md +25 -0
  31. package/.agent/rules/MEMORY_STATE.md +110 -0
  32. package/.agent/rules/REFERENCE.md +33 -141
  33. package/.agent/rules/REF_SKILLS.md +116 -0
  34. package/.agent/rules/REF_WORKFLOWS.md +81 -0
  35. package/.agent/scripts/ak_cli.py +106 -5
  36. package/.agent/scripts/memory_manager.py +48 -9
  37. package/.agent/skills/anti-hallucination/SKILL.md +295 -0
  38. package/.agent/skills/anti-hallucination/scripts/check_hallucination.py +299 -0
  39. package/.agent/skills/bifurcation-analysis/SKILL.md +56 -0
  40. package/.agent/skills/brainstorming/SKILL.md +80 -6
  41. package/.agent/skills/decision-memory/SKILL.md +317 -0
  42. package/.agent/skills/emergence-detector/SKILL.md +230 -0
  43. package/.agent/skills/emergence-detector/scripts/check_emergence.py +265 -0
  44. package/.agent/skills/explained-qa/SKILL.md +142 -0
  45. package/.agent/skills/explained-qa/game-terminology.md +214 -0
  46. package/.agent/skills/game-development/ai-dialogue-engine/SKILL.md +442 -0
  47. package/.agent/skills/game-development/ai-graphics-generator/SKILL.md +463 -0
  48. package/.agent/skills/game-development/ai-playtest-framework/SKILL.md +570 -0
  49. package/.agent/skills/game-development/camera-systems/SKILL.md +607 -0
  50. package/.agent/skills/game-development/card-battle-engine/SKILL.md +618 -0
  51. package/.agent/skills/game-development/character-controller-3d/SKILL.md +908 -0
  52. package/.agent/skills/game-development/cloud-save-sync/SKILL.md +527 -0
  53. package/.agent/skills/game-development/combat-system/SKILL.md +748 -0
  54. package/.agent/skills/game-development/compliance-rating/SKILL.md +277 -0
  55. package/.agent/skills/game-development/crossplatform-build/SKILL.md +386 -0
  56. package/.agent/skills/game-development/cultivation-progression/SKILL.md +520 -0
  57. package/.agent/skills/game-development/data-driven-balance/SKILL.md +535 -0
  58. package/.agent/skills/game-development/game-analytics-integrator/SKILL.md +410 -0
  59. package/.agent/skills/game-development/game-audio-advanced/SKILL.md +646 -0
  60. package/.agent/skills/game-development/game-economy-designer/SKILL.md +375 -0
  61. package/.agent/skills/game-development/game-marketing/SKILL.md +85 -0
  62. package/.agent/skills/game-development/game-state-manager/SKILL.md +883 -0
  63. package/.agent/skills/game-development/hybrid-game-spec/SKILL.md +220 -0
  64. package/.agent/skills/game-development/inventory-quest/SKILL.md +747 -0
  65. package/.agent/skills/game-development/liveops/SKILL.md +308 -0
  66. package/.agent/skills/game-development/localization/SKILL.md +286 -0
  67. package/.agent/skills/game-development/mobile-input-patterns/SKILL.md +343 -0
  68. package/.agent/skills/game-development/monetization-strategy/SKILL.md +94 -0
  69. package/.agent/skills/game-development/multiplayer-master/SKILL.md +727 -0
  70. package/.agent/skills/game-development/narrative-branching/SKILL.md +593 -0
  71. package/.agent/skills/game-development/procedural-level-ai/SKILL.md +367 -0
  72. package/.agent/skills/game-development/prototyping-rapid/SKILL.md +205 -0
  73. package/.agent/skills/game-development/spec-ecosystem/SKILL.md +155 -0
  74. package/.agent/skills/game-development/spec-ecosystem/decision-log-format.md +129 -0
  75. package/.agent/skills/game-development/spec-ecosystem/templates/PLAN-template.md +178 -0
  76. package/.agent/skills/game-development/spec-ecosystem/templates/SPEC-template.md +110 -0
  77. package/.agent/skills/game-development/spec-ecosystem/templates/TASKS-template.md +156 -0
  78. package/.agent/skills/game-development/survival-systems/SKILL.md +493 -0
  79. package/.agent/skills/game-development/testing-qa/SKILL.md +270 -0
  80. package/.agent/skills/game-development/unity-mobile-optimization/SKILL.md +271 -0
  81. package/.agent/skills/intent-capture/SKILL.md +65 -0
  82. package/.agent/skills/mcp-composition/SKILL.md +362 -0
  83. package/.agent/skills/mcp-observability/SKILL.md +323 -0
  84. package/.agent/skills/mcp-security/SKILL.md +314 -0
  85. package/.agent/skills/trust-spectrum/SKILL.md +291 -0
  86. package/.agent/skills/vibe-coding-guard/SKILL.md +328 -0
  87. package/.agent/templates/AGENTS.game.md +63 -0
  88. package/.agent/templates/docs/WORKFLOW_GUIDE.en.md +100 -0
  89. package/.agent/templates/docs/WORKFLOW_GUIDE.vi.md +100 -0
  90. package/.agent/workflows/ai-agent.md +2 -0
  91. package/.agent/workflows/autofix.md +1 -0
  92. package/.agent/workflows/brainstorm.md +1 -0
  93. package/.agent/workflows/context.md +1 -0
  94. package/.agent/workflows/create.md +39 -8
  95. package/.agent/workflows/dashboard.md +1 -0
  96. package/.agent/workflows/debug.md +14 -0
  97. package/.agent/workflows/deploy.md +14 -0
  98. package/.agent/workflows/enhance.md +44 -0
  99. package/.agent/workflows/gamekit-init.md +177 -0
  100. package/.agent/workflows/gamekit-launch.md +338 -0
  101. package/.agent/workflows/gamekit-plan.md +204 -0
  102. package/.agent/workflows/gamekit-qa.md +153 -0
  103. package/.agent/workflows/gamekit-spec.md +243 -0
  104. package/.agent/workflows/gamekit-tasks.md +208 -0
  105. package/.agent/workflows/marketing.md +2 -0
  106. package/.agent/workflows/next.md +1 -0
  107. package/.agent/workflows/orchestrate.md +12 -0
  108. package/.agent/workflows/pentest.md +2 -0
  109. package/.agent/workflows/plan.md +42 -0
  110. package/.agent/workflows/preview.md +1 -0
  111. package/.agent/workflows/quality.md +1 -0
  112. package/.agent/workflows/saas.md +2 -0
  113. package/.agent/workflows/spec.md +42 -0
  114. package/.agent/workflows/status.md +1 -0
  115. package/.agent/workflows/test.md +14 -0
  116. package/.agent/workflows/ui-ux-pro-max.md +1 -0
  117. package/bin/cli.js +411 -111
  118. package/package.json +1 -2
  119. package/.agent/agents/game-asset-curator.md +0 -317
  120. package/.agent/agents/game-narrative-designer.md +0 -310
  121. package/.agent/agents/game-qa-agent.md +0 -441
  122. package/.agent/workflows/game-prototype.md +0 -154
  123. package/docs/AI_DATA_INFRASTRUCTURE.md +0 -288
  124. package/docs/CHANGELOG_AI_INFRA.md +0 -141
  125. package/docs/MIGRATION_GUIDE_V1.9.md +0 -55
@@ -0,0 +1,520 @@
1
+ ---
2
+ name: cultivation-progression
3
+ description: Cultivation/Xianxia game systems. Realm advancement, breakthrough mechanics, cultivation techniques, sect/faction systems, spiritual roots, and power scaling for Unity.
4
+ ---
5
+
6
+ # Cultivation Progression Skill
7
+
8
+ > **Purpose**: Build cultivation/Xianxia games with deep progression systems.
9
+
10
+ ## When to Use
11
+ - Building cultivation/Xianxia games
12
+ - Implementing realm-based progression
13
+ - Creating sect/faction systems
14
+ - Designing spiritual power mechanics
15
+
16
+ ---
17
+
18
+ ## 1. Cultivation Realm System
19
+
20
+ ### Realm Data Structure
21
+ ```csharp
22
+ [CreateAssetMenu(fileName = "CultivationRealm", menuName = "Game/Cultivation/Realm")]
23
+ public class CultivationRealm : ScriptableObject
24
+ {
25
+ public string realmName;
26
+ public string realmNameChinese; // 炼气期
27
+ public int realmIndex;
28
+
29
+ [Header("Sub-Stages")]
30
+ public int subStages = 9; // Early, Mid, Late, Peak (or 1-9)
31
+
32
+ [Header("Requirements")]
33
+ public long qiRequired;
34
+ public int levelRequired;
35
+ public CultivationRealm previousRealm;
36
+
37
+ [Header("Breakthrough")]
38
+ public float baseBreakthroughChance = 0.5f;
39
+ public ItemData[] requiredPills;
40
+ public float tribulationDifficulty = 1f;
41
+
42
+ [Header("Bonuses")]
43
+ public float healthMultiplier = 1f;
44
+ public float qiCapacityMultiplier = 1f;
45
+ public float attackMultiplier = 1f;
46
+ public float lifespanYears = 100f;
47
+
48
+ [Header("Unlock")]
49
+ public TechniqueData[] unlockedTechniques;
50
+ public string[] unlockedAbilities;
51
+ }
52
+ ```
53
+
54
+ ### Realm Definitions Example
55
+ ```csharp
56
+ // Common Xianxia Realms:
57
+ // 1. Qi Condensation (炼气期) - Stages 1-9
58
+ // 2. Foundation Establishment (筑基期) - Early, Mid, Late, Peak
59
+ // 3. Core Formation (结丹期)
60
+ // 4. Nascent Soul (元婴期)
61
+ // 5. Spirit Severing (化神期)
62
+ // 6. Dao Seeking (合道期)
63
+ // 7. Immortal Ascension (渡劫期)
64
+
65
+ public static class RealmConstants
66
+ {
67
+ public static readonly string[] RealmNames = {
68
+ "Qi Condensation",
69
+ "Foundation Establishment",
70
+ "Core Formation",
71
+ "Nascent Soul",
72
+ "Spirit Severing",
73
+ "Dao Seeking",
74
+ "Immortal Ascension"
75
+ };
76
+
77
+ public static readonly long[] QiRequirements = {
78
+ 1000, // Qi Condensation
79
+ 10000, // Foundation
80
+ 100000, // Core Formation
81
+ 1000000, // Nascent Soul
82
+ 10000000, // Spirit Severing
83
+ 100000000, // Dao Seeking
84
+ 1000000000 // Immortal
85
+ };
86
+ }
87
+ ```
88
+
89
+ ---
90
+
91
+ ## 2. Cultivation Manager
92
+
93
+ ### Core System
94
+ ```csharp
95
+ public class CultivationManager : MonoBehaviour
96
+ {
97
+ [SerializeField] private CultivationRealm[] _allRealms;
98
+ [SerializeField] private CultivationConfig _config;
99
+
100
+ // Current State
101
+ public CultivationRealm CurrentRealm { get; private set; }
102
+ public int CurrentSubStage { get; private set; } = 1;
103
+ public long CurrentQi { get; private set; }
104
+ public long MaxQi => CalculateMaxQi();
105
+
106
+ // Spiritual Root (talent)
107
+ public SpiritualRoot SpiritualRoot { get; private set; }
108
+
109
+ // Events
110
+ public event Action<CultivationRealm, int> OnRealmChanged;
111
+ public event Action<long> OnQiChanged;
112
+ public event Action<bool> OnBreakthroughAttempt;
113
+
114
+ public void GainQi(long amount)
115
+ {
116
+ // Apply spiritual root bonus
117
+ float multiplier = SpiritualRoot.qiGainMultiplier;
118
+ long actualGain = (long)(amount * multiplier);
119
+
120
+ CurrentQi = Mathf.Min(CurrentQi + actualGain, MaxQi);
121
+ OnQiChanged?.Invoke(CurrentQi);
122
+
123
+ // Check for natural breakthrough trigger
124
+ if (CurrentQi >= MaxQi && CanAttemptBreakthrough())
125
+ {
126
+ GameEvents.OnBreakthroughAvailable?.Invoke(GetNextTarget());
127
+ }
128
+ }
129
+
130
+ public bool AttemptBreakthrough(BreakthroughType type)
131
+ {
132
+ if (!CanAttemptBreakthrough()) return false;
133
+
134
+ float chance = CalculateBreakthroughChance();
135
+ bool success = Random.value < chance;
136
+
137
+ OnBreakthroughAttempt?.Invoke(success);
138
+
139
+ if (success)
140
+ {
141
+ AdvanceCultivation();
142
+ return true;
143
+ }
144
+ else
145
+ {
146
+ // Failure consequences
147
+ ApplyBreakthroughFailure();
148
+ return false;
149
+ }
150
+ }
151
+
152
+ private void AdvanceCultivation()
153
+ {
154
+ if (CurrentSubStage < CurrentRealm.subStages)
155
+ {
156
+ CurrentSubStage++;
157
+ }
158
+ else
159
+ {
160
+ // Advance to next realm
161
+ int nextIndex = CurrentRealm.realmIndex + 1;
162
+ if (nextIndex < _allRealms.Length)
163
+ {
164
+ CurrentRealm = _allRealms[nextIndex];
165
+ CurrentSubStage = 1;
166
+ CurrentQi = 0; // Reset Qi for new realm
167
+
168
+ // Unlock new techniques
169
+ UnlockRealmTechniques(CurrentRealm);
170
+ }
171
+ }
172
+
173
+ OnRealmChanged?.Invoke(CurrentRealm, CurrentSubStage);
174
+ GameEvents.OnCultivationAdvanced?.Invoke(CurrentRealm, CurrentSubStage);
175
+ }
176
+
177
+ private float CalculateBreakthroughChance()
178
+ {
179
+ float baseChance = CurrentRealm.baseBreakthroughChance;
180
+
181
+ // Modifiers
182
+ float qiBonus = (float)CurrentQi / MaxQi * 0.2f; // Up to 20% from Qi
183
+ float pillBonus = GetPillBonus(); // From breakthrough pills
184
+ float rootBonus = SpiritualRoot.breakthroughBonus;
185
+ float locationBonus = GetLocationBonus(); // Sacred grounds
186
+
187
+ return Mathf.Clamp01(baseChance + qiBonus + pillBonus + rootBonus + locationBonus);
188
+ }
189
+
190
+ private void ApplyBreakthroughFailure()
191
+ {
192
+ // Lose some Qi
193
+ CurrentQi = (long)(CurrentQi * 0.5f);
194
+
195
+ // Possible cultivation deviation (走火入魔)
196
+ if (Random.value < 0.1f)
197
+ {
198
+ GameEvents.OnCultivationDeviation?.Invoke();
199
+ }
200
+ }
201
+ }
202
+ ```
203
+
204
+ ---
205
+
206
+ ## 3. Spiritual Root System
207
+
208
+ ### Talent System
209
+ ```csharp
210
+ [CreateAssetMenu(fileName = "SpiritualRoot", menuName = "Game/Cultivation/SpiritualRoot")]
211
+ public class SpiritualRoot : ScriptableObject
212
+ {
213
+ public string rootName;
214
+ public RootQuality quality;
215
+ public ElementType[] affinities;
216
+
217
+ [Header("Bonuses")]
218
+ public float qiGainMultiplier = 1f;
219
+ public float breakthroughBonus = 0f;
220
+ public float techniqueLearnSpeed = 1f;
221
+
222
+ [Header("Limits")]
223
+ public CultivationRealm maxRealmWithoutTreasure;
224
+ }
225
+
226
+ public enum RootQuality
227
+ {
228
+ Waste, // 废材 - Cannot cultivate normally
229
+ Inferior, // 下等 - Very slow
230
+ Common, // 普通 - Normal speed
231
+ Superior, // 上等 - Fast
232
+ Heavenly, // 天灵根 - Very fast
233
+ Chaos // 混沌根 - Legendary, all elements
234
+ }
235
+
236
+ public enum ElementType
237
+ {
238
+ Metal, // 金
239
+ Wood, // 木
240
+ Water, // 水
241
+ Fire, // 火
242
+ Earth, // 土
243
+ Lightning,
244
+ Ice,
245
+ Wind,
246
+ Dark,
247
+ Light
248
+ }
249
+ ```
250
+
251
+ ### Root Generation
252
+ ```csharp
253
+ public class SpiritualRootGenerator
254
+ {
255
+ private static readonly float[] QualityWeights = {
256
+ 0.10f, // Waste
257
+ 0.30f, // Inferior
258
+ 0.40f, // Common
259
+ 0.15f, // Superior
260
+ 0.04f, // Heavenly
261
+ 0.01f // Chaos
262
+ };
263
+
264
+ public static SpiritualRoot GenerateRandom()
265
+ {
266
+ // Roll quality
267
+ RootQuality quality = RollQuality();
268
+
269
+ // Roll elements based on quality
270
+ int elementCount = quality switch
271
+ {
272
+ RootQuality.Waste => 0,
273
+ RootQuality.Inferior => 1,
274
+ RootQuality.Common => Random.Range(1, 3),
275
+ RootQuality.Superior => Random.Range(2, 4),
276
+ RootQuality.Heavenly => 1, // Single pure element
277
+ RootQuality.Chaos => 5, // All five basic
278
+ _ => 1
279
+ };
280
+
281
+ // Create spiritual root
282
+ var root = ScriptableObject.CreateInstance<SpiritualRoot>();
283
+ root.quality = quality;
284
+ root.affinities = RollElements(elementCount);
285
+ root.qiGainMultiplier = GetQualityMultiplier(quality);
286
+
287
+ return root;
288
+ }
289
+ }
290
+ ```
291
+
292
+ ---
293
+
294
+ ## 4. Cultivation Techniques
295
+
296
+ ### Technique System
297
+ ```csharp
298
+ [CreateAssetMenu(fileName = "Technique", menuName = "Game/Cultivation/Technique")]
299
+ public class TechniqueData : ScriptableObject
300
+ {
301
+ public string techniqueName;
302
+ public string chineseName;
303
+ public TechniqueType type;
304
+ public TechniqueGrade grade;
305
+
306
+ [Header("Requirements")]
307
+ public CultivationRealm minRealm;
308
+ public ElementType[] requiredAffinities;
309
+
310
+ [Header("Levels")]
311
+ public int maxLevel = 10;
312
+ public long[] levelUpQiCost;
313
+
314
+ [Header("Effects Per Level")]
315
+ public TechniqueEffect[] effects;
316
+
317
+ [Header("Learning")]
318
+ public float baseLearningTime = 3600f; // seconds
319
+ public float comprehensionDifficulty = 1f;
320
+ }
321
+
322
+ public enum TechniqueType
323
+ {
324
+ Body, // 体修功法
325
+ Qi, // 气修功法
326
+ Soul, // 魂修功法
327
+ Sword, // 剑修功法
328
+ Formation, // 阵法
329
+ Alchemy, // 炼丹术
330
+ Artifact, // 炼器术
331
+ Movement, // 身法
332
+ Attack, // 攻击秘术
333
+ Defense // 防御秘术
334
+ }
335
+
336
+ public enum TechniqueGrade
337
+ {
338
+ Mortal, // 凡级
339
+ Yellow, // 黄级
340
+ Profound, // 玄级
341
+ Earth, // 地级
342
+ Heaven, // 天级
343
+ Saint, // 圣级
344
+ Divine // 神级
345
+ }
346
+ ```
347
+
348
+ ---
349
+
350
+ ## 5. Sect/Faction System
351
+
352
+ ### Sect Structure
353
+ ```csharp
354
+ [CreateAssetMenu(fileName = "Sect", menuName = "Game/Cultivation/Sect")]
355
+ public class SectData : ScriptableObject
356
+ {
357
+ public string sectName;
358
+ public SectType type;
359
+ public ElementType primaryElement;
360
+
361
+ [Header("Hierarchy")]
362
+ public SectRank[] ranks;
363
+
364
+ [Header("Benefits")]
365
+ public float qiGainBonus = 0.1f;
366
+ public TechniqueData[] sectTechniques;
367
+ public ItemData[] monthlyRewards;
368
+
369
+ [Header("Requirements")]
370
+ public int minAgeToJoin = 12;
371
+ public int maxAgeToJoin = 20;
372
+ public RootQuality minRootQuality = RootQuality.Common;
373
+ }
374
+
375
+ [System.Serializable]
376
+ public class SectRank
377
+ {
378
+ public string rankName; // Outer Disciple, Inner Disciple, Core Disciple, Elder
379
+ public int contributionRequired;
380
+ public int realmRequired;
381
+ public float resourceMultiplier;
382
+ }
383
+
384
+ public enum SectType
385
+ {
386
+ Righteous, // 正道
387
+ Demonic, // 魔道
388
+ Neutral, // 中立
389
+ Hidden // 隐世
390
+ }
391
+ ```
392
+
393
+ ### Sect Manager
394
+ ```csharp
395
+ public class SectManager : MonoBehaviour
396
+ {
397
+ public SectData CurrentSect { get; private set; }
398
+ public SectRank CurrentRank { get; private set; }
399
+ public int Contribution { get; private set; }
400
+ public int Reputation { get; private set; }
401
+
402
+ public event Action<SectData> OnJoinedSect;
403
+ public event Action<SectRank> OnRankPromoted;
404
+
405
+ public bool TryJoinSect(SectData sect)
406
+ {
407
+ if (CurrentSect != null) return false;
408
+ if (!MeetsRequirements(sect)) return false;
409
+
410
+ CurrentSect = sect;
411
+ CurrentRank = sect.ranks[0]; // Start as Outer Disciple
412
+
413
+ OnJoinedSect?.Invoke(sect);
414
+ return true;
415
+ }
416
+
417
+ public void AddContribution(int amount)
418
+ {
419
+ Contribution += amount;
420
+ CheckForPromotion();
421
+ }
422
+
423
+ public void CompleteSectMission(SectMission mission)
424
+ {
425
+ AddContribution(mission.contributionReward);
426
+ Reputation += mission.reputationReward;
427
+
428
+ GameEvents.OnSectMissionCompleted?.Invoke(mission);
429
+ }
430
+
431
+ private void CheckForPromotion()
432
+ {
433
+ int currentIndex = Array.IndexOf(CurrentSect.ranks, CurrentRank);
434
+ if (currentIndex < CurrentSect.ranks.Length - 1)
435
+ {
436
+ var nextRank = CurrentSect.ranks[currentIndex + 1];
437
+ if (Contribution >= nextRank.contributionRequired)
438
+ {
439
+ CurrentRank = nextRank;
440
+ OnRankPromoted?.Invoke(nextRank);
441
+ }
442
+ }
443
+ }
444
+ }
445
+ ```
446
+
447
+ ---
448
+
449
+ ## 6. Tribulation System
450
+
451
+ ### Heavenly Tribulation
452
+ ```csharp
453
+ public class TribulationManager : MonoBehaviour
454
+ {
455
+ [SerializeField] private TribulationConfig _config;
456
+
457
+ public bool IsUnderTribulation { get; private set; }
458
+ public int CurrentWave { get; private set; }
459
+ public int TotalWaves { get; private set; }
460
+
461
+ public event Action OnTribulationStarted;
462
+ public event Action<bool> OnTribulationEnded;
463
+
464
+ public void TriggerTribulation(CultivationRealm targetRealm)
465
+ {
466
+ IsUnderTribulation = true;
467
+ TotalWaves = CalculateWaves(targetRealm);
468
+ CurrentWave = 0;
469
+
470
+ OnTribulationStarted?.Invoke();
471
+ StartCoroutine(RunTribulation(targetRealm));
472
+ }
473
+
474
+ private IEnumerator RunTribulation(CultivationRealm realm)
475
+ {
476
+ for (int i = 0; i < TotalWaves; i++)
477
+ {
478
+ CurrentWave = i + 1;
479
+
480
+ // Spawn lightning strike
481
+ float damage = CalculateLightningDamage(realm, i);
482
+ yield return SpawnLightningStrike(damage);
483
+
484
+ // Wait between waves
485
+ yield return new WaitForSeconds(_config.waveCooldown);
486
+
487
+ // Check if player survived
488
+ if (PlayerManager.Instance.IsDead)
489
+ {
490
+ OnTribulationEnded?.Invoke(false);
491
+ yield break;
492
+ }
493
+ }
494
+
495
+ // Survived all waves
496
+ IsUnderTribulation = false;
497
+ OnTribulationEnded?.Invoke(true);
498
+ GameEvents.OnTribulationSurvived?.Invoke(realm);
499
+ }
500
+ }
501
+ ```
502
+
503
+ ---
504
+
505
+ ## Anti-Patterns
506
+
507
+ | ❌ Don't | ✅ Do |
508
+ |----------|-------|
509
+ | Linear power scaling | Exponential scaling (10x per realm) |
510
+ | Guaranteed breakthroughs | RNG with failure consequences |
511
+ | Single progression path | Multiple cultivation methods |
512
+ | Ignore Chinese terminology | Include both English and Chinese names |
513
+ | Static techniques | Leveled techniques with mastery |
514
+
515
+ ---
516
+
517
+ ## Related Skills
518
+ - `game-development/game-economy-designer` - Resource balancing
519
+ - `game-development/combat-system` - Cultivation combat
520
+ - `game-development/narrative-branching` - Sect storylines