mirror of
https://port.numenaute.org/aleajactaest/bazar_alea.git
synced 2024-11-09 16:59:02 +00:00
63 lines
2.2 KiB
GDScript
63 lines
2.2 KiB
GDScript
extends Node
|
|
|
|
#------------------ Player Enums ------------------#
|
|
# Demarche (Attend, Marche, Cours, sprint
|
|
enum GAIT {WAITING, WALKING , RUNNING , SPRINTING}
|
|
# Sol, Air, Couverture, poupee de chiffon
|
|
enum MOVEMENT_STATE {NONE , GROUNDED , IN_AIR , MANTLING, RAGDOLL}
|
|
#
|
|
enum MOVEMENT_ACTION {NONE ,LOW_MANTLE , HIGH_MANTLE , ROLLING , GETTING_UP}
|
|
# Fusis, Pistolet
|
|
enum OVERLAY_STATE {DEFAULT , RIFLE , PISTOL}
|
|
#
|
|
enum ROTATION_MODE {VELOCITY_DIRECTION , LOOKING_DIRECTION , AIMING}
|
|
# Position (debout, accroupi)
|
|
enum STANCE {STANDING , CROUCHING}
|
|
#
|
|
enum VIEW_MODE {THIRD_PERSON , FIRST_PERSON}
|
|
#
|
|
enum VIEW_ANGLE {RIGHT_SHOULDER , LEFT_SHOULDER , HEAD}
|
|
# Type de cape/manteau
|
|
enum MANTLE_TYPE {HIGH_MANTLE , LOW_MANTLE, FALLING_CATCH}
|
|
# Direction du mouvement (devant, droite, gauche, arriere)
|
|
enum MOVEMENT_DIRECTION {FORWARD , RIGHT, LEFT, BACKWARD}
|
|
|
|
|
|
func map_range_clamped(value,InputMin,InputMax,OutputMin,OutputMax):
|
|
value = clamp(value,InputMin,InputMax)
|
|
return ((value - InputMin) / (InputMax - InputMin) * (OutputMax - OutputMin) + OutputMin)
|
|
|
|
|
|
func get_time_text() -> String:
|
|
var time = Time.get_datetime_dict_from_system()
|
|
return "%s/%02d/%02d %02d:%02d:%02d" % [
|
|
time['year'], time['month'], time['day'],
|
|
time['hour'], time['minute'], time['second'],
|
|
]
|
|
|
|
func get_time_only_text() -> String:
|
|
var time = Time.get_datetime_dict_from_system()
|
|
return "%02d:%02d:%02d" % [
|
|
time['hour'], time['minute'], time['second'],
|
|
]
|
|
|
|
func msg_debug(format_string:String, array_text:Array) -> void:
|
|
var formattage = "%s DEBUG [%s:%d] " + format_string
|
|
var frame = get_stack()[1]
|
|
var param = [get_time_text(), frame.source, frame.line]
|
|
param.append_array(array_text)
|
|
print( formattage % param )
|
|
|
|
func msg_info(format_string:String, array_text:Array) -> void:
|
|
var formattage = "%s INFO [%s:%d] " + format_string
|
|
var frame = get_stack()[1]
|
|
var param = [get_time_text(), frame.source, frame.line]
|
|
param.append_array(array_text)
|
|
print( formattage % param )
|
|
|
|
func msg_error(format_string:String, array_text:Array) -> void:
|
|
var formattage = "%s ERROR [%s:%d] " + format_string
|
|
var frame = get_stack()[1]
|
|
var param = [get_time_text(), frame.source, frame.line]
|
|
param.append_array(array_text)
|
|
print( formattage % param )
|