重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
godot-economy-system by thedivergentai/gd-agentic-skills
npx skills add https://github.com/thedivergentai/gd-agentic-skills --skill godot-economy-system为设计包含货币、商店和战利品的平衡游戏经济提供专家指导。
用于定义不同货币单位(金币、宝石、经验值)及其用户界面元数据的专用数据容器。
集中式的 AutoLoad 协调器,用于管理余额和处理安全交易。
基于资源的可购买物品定义,包括定价、货币类型和库存限制。
用于处理钱包和库存系统之间买卖交换的解耦逻辑。
基于世界状态(例如促销活动)应用临时折扣或加价的注入模式。
响应式用户界面钩子,用于在余额变化时自动更新货币显示。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
用于捕获战利品事件并将资金添加到玩家钱包的桥接节点。
用于将财务状态序列化为安全、可加载字典的专家逻辑。
视觉反馈控制器,在获得资金时触发粒子或动画效果。
用于多物品“以物易物”交易的高级易货系统定义。
int — 标准的 32 位整数上限为 21 亿。对于海量数量,请使用 float 或自定义的 BigInt 结构 [12]。if current >= amount。负金币会破坏逻辑和存档文件。WalletManager 应决定其是否有效并更新状态。0.1 + 0.2 可能等于 0.30000000000000004,导致差异。对于分/最小单位使用 int。# economy_manager.gd (AutoLoad)
extends Node
signal currency_changed(old_amount: int, new_amount: int)
var gold: int = 0
func add_currency(amount: int) -> void:
var old := gold
gold += amount
currency_changed.emit(old, gold)
func spend_currency(amount: int) -> bool:
if gold < amount:
return false
var old := gold
gold -= amount
currency_changed.emit(old, gold)
return true
func has_currency(amount: int) -> bool:
return gold >= amount
# shop_item.gd
class_name ShopItem
extends Resource
@export var item: Item
@export var buy_price: int
@export var sell_price: int
@export var stock: int = -1 # -1 = infinite
func can_buy() -> bool:
return stock != 0
# shop.gd
class_name Shop
extends Resource
@export var shop_name: String
@export var items: Array[ShopItem] = []
func buy_item(shop_item: ShopItem, inventory: Inventory) -> bool:
if not shop_item.can_buy():
return false
if not EconomyManager.has_currency(shop_item.buy_price):
return false
if not EconomyManager.spend_currency(shop_item.buy_price):
return false
inventory.add_item(shop_item.item, 1)
if shop_item.stock > 0:
shop_item.stock -= 1
return true
func sell_item(item: Item, inventory: Inventory) -> bool:
# Find matching shop item for sell price
var shop_item := get_shop_item_for(item)
if not shop_item:
return false
if not inventory.has_item(item, 1):
return false
inventory.remove_item(item, 1)
EconomyManager.add_currency(shop_item.sell_price)
return true
func get_shop_item_for(item: Item) -> ShopItem:
for shop_item in items:
if shop_item.item == item:
return shop_item
return null
func calculate_sell_price(buy_price: int, markup: float = 0.5) -> int:
# Sell for 50% of buy price
return int(buy_price * markup)
func calculate_dynamic_price(base_price: int, demand: float) -> int:
# Price increases with demand
return int(base_price * (1.0 + demand))
# loot_table.gd
class_name LootTable
extends Resource
@export var drops: Array[LootDrop] = []
func roll_loot() -> Array[Item]:
var items: Array[Item] = []
for drop in drops:
if randf() < drop.chance:
items.append(drop.item)
return items
# loot_drop.gd
class_name LootDrop
extends Resource
@export var item: Item
@export var chance: float = 0.5
@export var min_amount: int = 1
@export var max_amount: int = 1
godot-inventory-system, godot-save-load-systems每周安装数
71
代码仓库
GitHub 星标数
59
首次出现
2026年2月10日
安全审计
已安装于
gemini-cli70
codex69
opencode68
amp66
github-copilot66
kimi-cli66
Expert guidance for designing balanced game economies with currency, shops, and loot.
Specialized data container for defining distinct denominations (Gold, Gems, XP) with UI metadata.
Centralized AutoLoad orchestrator for managing balances and processing secure transactions.
Resource-based definition for purchasables, including pricing, currency types, and stock limits.
Decoupled logic for handling buy/sell exchanges between the Wallet and Inventory systems.
Injection pattern for applying temporary discounts or markups based on world state (e.g. Sales).
Reactive UI hook for automatically updating currency displays when balances change.
Bridge node for capturing loot events and adding funds to the player's wallet.
Expert logic for serializing financial states into secure, loadable dictionaries.
Visual feedback controller that triggers particles or animations upon financial gain.
Advanced barter system definition for multi-item "Quid Pro Quo" transactions.
int for large-scale premium economies — Standard 32-bit integers cap at 2.1 billion. For massive quantities, use float or a custom BigInt structure [12].if current >= amount BEFORE subtracting. Negative gold can break logic and save files.WalletManager should decide if it's valid and update the state.# economy_manager.gd (AutoLoad)
extends Node
signal currency_changed(old_amount: int, new_amount: int)
var gold: int = 0
func add_currency(amount: int) -> void:
var old := gold
gold += amount
currency_changed.emit(old, gold)
func spend_currency(amount: int) -> bool:
if gold < amount:
return false
var old := gold
gold -= amount
currency_changed.emit(old, gold)
return true
func has_currency(amount: int) -> bool:
return gold >= amount
# shop_item.gd
class_name ShopItem
extends Resource
@export var item: Item
@export var buy_price: int
@export var sell_price: int
@export var stock: int = -1 # -1 = infinite
func can_buy() -> bool:
return stock != 0
# shop.gd
class_name Shop
extends Resource
@export var shop_name: String
@export var items: Array[ShopItem] = []
func buy_item(shop_item: ShopItem, inventory: Inventory) -> bool:
if not shop_item.can_buy():
return false
if not EconomyManager.has_currency(shop_item.buy_price):
return false
if not EconomyManager.spend_currency(shop_item.buy_price):
return false
inventory.add_item(shop_item.item, 1)
if shop_item.stock > 0:
shop_item.stock -= 1
return true
func sell_item(item: Item, inventory: Inventory) -> bool:
# Find matching shop item for sell price
var shop_item := get_shop_item_for(item)
if not shop_item:
return false
if not inventory.has_item(item, 1):
return false
inventory.remove_item(item, 1)
EconomyManager.add_currency(shop_item.sell_price)
return true
func get_shop_item_for(item: Item) -> ShopItem:
for shop_item in items:
if shop_item.item == item:
return shop_item
return null
func calculate_sell_price(buy_price: int, markup: float = 0.5) -> int:
# Sell for 50% of buy price
return int(buy_price * markup)
func calculate_dynamic_price(base_price: int, demand: float) -> int:
# Price increases with demand
return int(base_price * (1.0 + demand))
# loot_table.gd
class_name LootTable
extends Resource
@export var drops: Array[LootDrop] = []
func roll_loot() -> Array[Item]:
var items: Array[Item] = []
for drop in drops:
if randf() < drop.chance:
items.append(drop.item)
return items
# loot_drop.gd
class_name LootDrop
extends Resource
@export var item: Item
@export var chance: float = 0.5
@export var min_amount: int = 1
@export var max_amount: int = 1
godot-inventory-system, godot-save-load-systemsWeekly Installs
71
Repository
GitHub Stars
59
First Seen
Feb 10, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli70
codex69
opencode68
amp66
github-copilot66
kimi-cli66
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
122,000 周安装
通用项目发布工具 - 多语言更新日志自动生成 | 支持Node.js/Python/Rust/Claude插件
62 周安装
Edge Pipeline Orchestrator:自动化金融交易策略流水线编排工具
62 周安装
Python ROI 计算器:投资回报率、营销ROI、盈亏平衡分析工具
62 周安装
Salesforce Hyperforce 2025架构指南:云原生、零信任安全与开发最佳实践
62 周安装
PowerShell 2025 重大变更与迁移指南:版本移除、模块停用、WMIC替代方案
62 周安装
2025安全优先Bash脚本编写指南:输入验证、命令注入与路径遍历防护
62 周安装
0.1 + 0.2 might equal 0.30000000000000004, leading to discrepancies. Use int for cents/smallest units.