class_name RoleTool extends Node static func get_role_data(id): if Global.global_role_data.has(id): return Global.global_role_data[id] else: Global.global_role_data[id] = Global.role_data[id] return Global.global_role_data[id] #计算角色临时属性 static func calculate_temporary_properties(role_data): role_data["temporary"]["hp"] = Func.role_count_data("hp",role_data) role_data["temporary"]["san"] = Func.role_count_data("san",role_data) role_data["temporary"]["mp"] = Func.role_count_data("mp",role_data) role_data["temporary"]["action"] = Func.role_count_data("action",role_data) role_data["temporary"]["state_resis"] = Func.role_count_data("state_resis",role_data) role_data["temporary"]["str_hit_rate"] = Func.role_count_data("str_hit_rate",role_data) role_data["temporary"]["per_hit_rate"] = Func.role_count_data("per_hit_rate",role_data) role_data["temporary"]["dodge_chance"] = Func.role_count_data("dodge_chance",role_data) role_data["temporary"]["critical_chance"] = Func.role_count_data("critical_chance",role_data) role_data["temporary"]["weapon_damage"] = 50 role_data["temporary"]["magic_damage"] = 1 role_data["temporary"]["physical_def"] = 0 role_data["temporary"]["magic_def"] = 0 for key in role_data["temporary"].keys(): role_data["temporary"]["fixation_"+key] = 0 role_data["temporary"]["intensity_"+key] = 1 pass