|
|
|
@ -21,6 +21,7 @@ func init(id:int,cfg:CharacterCfg,team:Enum.ETeam):
|
|
|
|
collision.scale = body_scale
|
|
|
|
collision.scale = body_scale
|
|
|
|
status.basic_offset = Vector3(0,half_height,0)
|
|
|
|
status.basic_offset = Vector3(0,half_height,0)
|
|
|
|
status.ui_offset = Vector3(0,height*1.1,0)
|
|
|
|
status.ui_offset = Vector3(0,height*1.1,0)
|
|
|
|
|
|
|
|
status.ui_center_offset = Vector3(0,half_height,0)
|
|
|
|
status.radius = width
|
|
|
|
status.radius = width
|
|
|
|
status.height = height
|
|
|
|
status.height = height
|
|
|
|
view.init(cfg.sprite_frames)
|
|
|
|
view.init(cfg.sprite_frames)
|
|
|
|
@ -29,16 +30,16 @@ func init(id:int,cfg:CharacterCfg,team:Enum.ETeam):
|
|
|
|
|
|
|
|
|
|
|
|
func init_after():
|
|
|
|
func init_after():
|
|
|
|
var cfg = status.cfg as CharacterCfg
|
|
|
|
var cfg = status.cfg as CharacterCfg
|
|
|
|
set_status("hp",cfg.hp_max)
|
|
|
|
|
|
|
|
set_status("hp_max",cfg.hp_max)
|
|
|
|
set_status("hp_max",cfg.hp_max)
|
|
|
|
set_status("shield",cfg.shield.shield_max)
|
|
|
|
set_status("hp",cfg.hp_max)
|
|
|
|
set_status("shield_max",cfg.shield.shield_max)
|
|
|
|
set_status("shield_max",cfg.shield.shield_max)
|
|
|
|
set_status("stun",0)
|
|
|
|
set_status("shield",cfg.shield.shield_max)
|
|
|
|
set_status("stun_max",cfg.stun.stun_max)
|
|
|
|
set_status("stun_max",cfg.stun.stun_max)
|
|
|
|
set_status("mp",0)
|
|
|
|
set_status("stun",0)
|
|
|
|
set_status("mp_max",cfg.mp.mp_max)
|
|
|
|
set_status("mp_max",cfg.mp.mp_max)
|
|
|
|
set_status("mp_sub",0)
|
|
|
|
set_status("mp",0)
|
|
|
|
set_status("mp_sub_max",cfg.mp.mp_sub_max)
|
|
|
|
set_status("mp_sub_max",cfg.mp.mp_sub_max)
|
|
|
|
|
|
|
|
set_status("mp_sub",0)
|
|
|
|
|
|
|
|
|
|
|
|
func set_material(material:ShaderMaterial):
|
|
|
|
func set_material(material:ShaderMaterial):
|
|
|
|
view.material_override = material
|
|
|
|
view.material_override = material
|
|
|
|
@ -71,6 +72,7 @@ func radius()->float:return status.radius
|
|
|
|
func height()->float:return status.height
|
|
|
|
func height()->float:return status.height
|
|
|
|
func view_pos()->Vector3:return position + view.position
|
|
|
|
func view_pos()->Vector3:return position + view.position
|
|
|
|
func ui_pos()->Vector3:return position + status.ui_offset
|
|
|
|
func ui_pos()->Vector3:return position + status.ui_offset
|
|
|
|
|
|
|
|
func ui_pos_center()->Vector3:return position + status.ui_center_offset
|
|
|
|
|
|
|
|
|
|
|
|
#==interface==
|
|
|
|
#==interface==
|
|
|
|
func get_status(status_name:String):return status.get_status(status_name)
|
|
|
|
func get_status(status_name:String):return status.get_status(status_name)
|
|
|
|
|