mirror of
https://gitee.com/freeyz/godot-mota.git
synced 2024-11-18 00:39:23 +08:00
48 lines
821 B
GDScript3
48 lines
821 B
GDScript3
|
extends Object
|
||
|
|
||
|
class_name PlayerProperty
|
||
|
|
||
|
# 英雄名称
|
||
|
var username : String = "hero"
|
||
|
|
||
|
# 英雄血量
|
||
|
var hp : int = 1000
|
||
|
|
||
|
# 英雄攻击力
|
||
|
var atk : int = 1
|
||
|
|
||
|
# 英雄防御力
|
||
|
var def : int = 1
|
||
|
|
||
|
#默认金钱
|
||
|
var money : int = 0
|
||
|
|
||
|
# 英雄等级
|
||
|
var level : int = 1
|
||
|
|
||
|
# 英雄经验
|
||
|
var experience : int = 0
|
||
|
|
||
|
# 当前楼层
|
||
|
var now_floor = 1
|
||
|
|
||
|
# 去过的最大楼层
|
||
|
var max_floor = 1
|
||
|
|
||
|
# 去过的最小楼层
|
||
|
var min_floor = 1
|
||
|
|
||
|
# 被使用的道具
|
||
|
var used_items : Dictionary = {}
|
||
|
|
||
|
# 增加使用过的道具
|
||
|
func add_used_item(now_floor:int,id:int) -> void:
|
||
|
if not used_items.has(now_floor):
|
||
|
used_items[now_floor] = []
|
||
|
var items = used_items[now_floor] as Array
|
||
|
items.append(id)
|
||
|
|
||
|
# 根据楼层查询被使用过的道具
|
||
|
func get_used_items_by_floor(query_floor:int) -> Array:
|
||
|
return used_items[query_floor]
|