Signed-off-by: TsubakiLoL <2789646812@qq.com>
This commit is contained in:
TsubakiLoL 2024-11-11 16:28:00 +08:00
parent 1afda410a0
commit 5a7ebda44a
3 changed files with 59 additions and 3 deletions

View File

@ -511,7 +511,14 @@ var triger:Dictionary={
"show_warehouse":func(data):now_game_flow.show_warehouse(),
"make_card":func(data):now_game_flow.show_make_card(),
#人类特质触发器,触发为当前游戏人物属性随机加一
"human":func(data):human_triger()
"human":func(data):human_triger(),
#角色处理触发器
"character_data_process":func(data):return character_process(data)
}
#使用事件触发器
@ -529,6 +536,29 @@ func human_triger():
var key:String=basic_attribute_dic.keys()[rand]
basic_attribute_dic[key]+=1
pass
#角色数据处理触发器(用于特殊特质,返回处理后的临时角色数据)
func character_process(data:Dictionary):
var type=data["type"]
var from_data:Dictionary
#确定处理的数据来源处理时要手动塞进data里,如果缺省默认作为主角
if data.has("from_data"):
from_data=data["from_data"].duolicate(true)
else:
from_data=get_now_character_data()
match type:
#对基础属性的修改(数值增减)
"attribute_change":
var attribute_name:String=data["attribute_name"]
if from_data.has("attribute") and from_data["attribute"].has(attribute_name):
#基础增减
if data.has("change_normal"):
from_data["attribute"][attribute_name]+=from_data["change_normal"]
if data.has("change_percent"):
from_data["attribute"][attribute_name]*=(1+from_data["change_percent"])
return from_data
#条件触发器(用于返回是否的条件判定结果)
var condition_triger:Dictionary={
"date_limit":func (data:Dictionary):return TimeTool.is_in_date(data,get_time_dictionary()),

View File

@ -9,6 +9,32 @@
"type":"human",
"data":""
}],
},
"minrui":{
"name":"敏锐",
"introduction":"调查时:感知+5",
"type":"identfication",
"triger":[{
"type":"character_data_process",
"data":{
"type":"attribute_change",
"attribute_name":"WIS",
"change_normal":5
}
}]
},
"tanlan":{
"name":"贪婪",
"introduction":"贪欲挑战时:意志-10",
"type":"identfication",
"triger":[{
"type":"character_data_process",
"data":{
"type":"attribute_change",
"attribute_name":"WIS",
"change_normal":5
}
}]
}

View File

@ -346,12 +346,11 @@ layout_mode = 2
size_flags_vertical = 3
size_flags_stretch_ratio = 939.0
theme_override_styles/panel = SubResource("StyleBoxEmpty_81i7t")
current_tab = 1
current_tab = 0
clip_tabs = false
tabs_visible = false
[node name="basic_mes" type="MarginContainer" parent="VBoxContainer/TabContainer"]
visible = false
layout_mode = 2
theme_override_constants/margin_right = 19
theme_override_constants/margin_bottom = 43
@ -1167,6 +1166,7 @@ vertical_alignment = 1
metadata/_edit_use_anchors_ = true
[node name="special_ability" type="MarginContainer" parent="VBoxContainer/TabContainer"]
visible = false
layout_mode = 2
theme_override_constants/margin_left = 54
theme_override_constants/margin_top = 8