forked from Nekojimi/JackIt
22 lines
963 B
GDScript3
22 lines
963 B
GDScript3
|
extends PickPlayerAction
|
||
|
class_name InvestigateNightAction
|
||
|
|
||
|
@export var investigated_property: NodePath
|
||
|
@export var property_names: Dictionary = {}
|
||
|
|
||
|
func execute_with_target(user: WolfPlayer, target: WolfPlayer) -> bool:
|
||
|
if !super.execute_with_target(user, target):
|
||
|
return false
|
||
|
var arr: Array = target.get_node_and_resource(investigated_property)
|
||
|
var property: Variant = arr[1].get_indexed(arr[2])
|
||
|
if property == null:
|
||
|
printerr("The property named %s was not found." % investigated_property)
|
||
|
return false
|
||
|
if target.role.special_investigation_results.has(user.role.name):
|
||
|
property = target.role.special_investigation_results.get(user.role.name, "")
|
||
|
var property_name: String = property_names.get(property, "%s" % property)
|
||
|
user.add_message_context("property",property_name)
|
||
|
#var message: String = message_success.format({"user"=user.player_name, "target"=target.player_name, "property"=property_name})
|
||
|
#user.enqueue_message(message)
|
||
|
return true
|