knife
This commit is contained in:
parent
83839459ff
commit
6b5e768faf
15 changed files with 4250 additions and 2343 deletions
Binary file not shown.
Binary file not shown.
BIN
models/characters/viewmodels/molikman_hands_tex_knife.png
Normal file
BIN
models/characters/viewmodels/molikman_hands_tex_knife.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
|
|
@ -0,0 +1,44 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://pdepam77xqnq"
|
||||||
|
path.s3tc="res://.godot/imported/molikman_hands_tex_knife.png-2798e11b63950b7ab64bd9cfdc9526c2.s3tc.ctex"
|
||||||
|
metadata={
|
||||||
|
"imported_formats": ["s3tc_bptc"],
|
||||||
|
"vram_texture": true
|
||||||
|
}
|
||||||
|
generator_parameters={
|
||||||
|
"md5": "4e73f55f15c15350685cfd902157007e"
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://models/characters/viewmodels/molikman_hands_tex_knife.png"
|
||||||
|
dest_files=["res://.godot/imported/molikman_hands_tex_knife.png-2798e11b63950b7ab64bd9cfdc9526c2.s3tc.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=2
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=true
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=0
|
||||||
6417
scenes/molikman.tscn
6417
scenes/molikman.tscn
File diff suppressed because one or more lines are too long
|
|
@ -1,46 +1,30 @@
|
||||||
[gd_scene load_steps=8 format=3 uid="uid://ts4xccpkjd3g"]
|
[gd_scene load_steps=6 format=3 uid="uid://ts4xccpkjd3g"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://e6lqknfl4ngt" path="res://scripts/weapon_system/weapon_substate_machine.gd" id="1_2xf1r"]
|
[ext_resource type="Script" uid="uid://e6lqknfl4ngt" path="res://scripts/weapon_system/weapon_substate_machine.gd" id="1_2xf1r"]
|
||||||
[ext_resource type="Script" uid="uid://ofv4e3dsfe8" path="res://scripts/weapon_system/gun/idle_state.gd" id="2_c20fe"]
|
[ext_resource type="Script" uid="uid://dhmgd83rhjtyq" path="res://scripts/weapon_system/knife/knife_intro.gd" id="2_6fi8m"]
|
||||||
[ext_resource type="Script" uid="uid://vj13r83l3xyq" path="res://scripts/weapon_system/gun/semi_auto_shoot_state.gd" id="3_qf5yf"]
|
[ext_resource type="Script" uid="uid://cn6wyj4v5xeej" path="res://scripts/weapon_system/knife/knife_idle.gd" id="3_7hrnw"]
|
||||||
[ext_resource type="Script" uid="uid://hmekwp8444ao" path="res://scripts/weapon_system/gun/reload_state.gd" id="4_ndam4"]
|
[ext_resource type="Script" uid="uid://d0r2fu21ei4hy" path="res://scripts/weapon_system/knife/knife_attack.gd" id="4_7hrnw"]
|
||||||
[ext_resource type="Script" uid="uid://bmj0bwy2tlian" path="res://scripts/weapon_system/gun/intro_state.gd" id="5_qa48d"]
|
[ext_resource type="Script" uid="uid://ctx2rjjs48nrc" path="res://scripts/weapon_system/knife/knife_attack_heavy.gd" id="5_c20fe"]
|
||||||
|
|
||||||
[sub_resource type="Curve" id="Curve_6djxj"]
|
|
||||||
_limits = [0.0, 0.1, 0.0, 20.0]
|
|
||||||
metadata/_snap_enabled = true
|
|
||||||
metadata/_snap_count = 8
|
|
||||||
|
|
||||||
[sub_resource type="Curve" id="Curve_qb62r"]
|
|
||||||
_limits = [-0.02, 0.02, 0.0, 20.0]
|
|
||||||
|
|
||||||
[node name="Knife" type="Node" node_paths=PackedStringArray("enter_state")]
|
[node name="Knife" type="Node" node_paths=PackedStringArray("enter_state")]
|
||||||
script = ExtResource("1_2xf1r")
|
script = ExtResource("1_2xf1r")
|
||||||
animation_prefix = &"baked_sp_"
|
animation_prefix = &"baked_knife_"
|
||||||
visibility_target = &"sp"
|
visibility_target = &"knife"
|
||||||
max_ammo = 1000000000
|
|
||||||
ammo_mags = 0
|
ammo_mags = 0
|
||||||
slot = &"knife"
|
slot = &"knife"
|
||||||
enter_state = NodePath("Intro")
|
enter_state = NodePath("Intro")
|
||||||
metadata/_custom_type_script = "uid://e6lqknfl4ngt"
|
metadata/_custom_type_script = "uid://e6lqknfl4ngt"
|
||||||
|
|
||||||
[node name="Idle" type="Node" parent="."]
|
|
||||||
script = ExtResource("2_c20fe")
|
|
||||||
|
|
||||||
[node name="Shoot" type="Node" parent="." node_paths=PackedStringArray("fire_timer")]
|
|
||||||
script = ExtResource("3_qf5yf")
|
|
||||||
vertical_curve = SubResource("Curve_6djxj")
|
|
||||||
horizontal_curve = SubResource("Curve_qb62r")
|
|
||||||
damage = 50
|
|
||||||
shoot_distance = 2.0
|
|
||||||
fire_timer = NodePath("../FireTimer")
|
|
||||||
|
|
||||||
[node name="Reload" type="Node" parent="."]
|
|
||||||
script = ExtResource("4_ndam4")
|
|
||||||
|
|
||||||
[node name="Intro" type="Node" parent="."]
|
[node name="Intro" type="Node" parent="."]
|
||||||
script = ExtResource("5_qa48d")
|
script = ExtResource("2_6fi8m")
|
||||||
|
|
||||||
[node name="FireTimer" type="Timer" parent="."]
|
[node name="Idle" type="Node" parent="."]
|
||||||
wait_time = 0.15
|
script = ExtResource("3_7hrnw")
|
||||||
one_shot = true
|
|
||||||
|
[node name="Attack" type="Node" parent="."]
|
||||||
|
script = ExtResource("4_7hrnw")
|
||||||
|
damage = 25
|
||||||
|
|
||||||
|
[node name="HeavyAttack" type="Node" parent="."]
|
||||||
|
script = ExtResource("5_c20fe")
|
||||||
|
damage = 60
|
||||||
|
|
|
||||||
|
|
@ -256,6 +256,7 @@ func shoot_internal(id:int , damage: int, distance: float) -> void:
|
||||||
ray.collision_mask |= ATTACK_LAYER | DEFENCE_LAYER
|
ray.collision_mask |= ATTACK_LAYER | DEFENCE_LAYER
|
||||||
|
|
||||||
var collision = space.intersect_ray(ray)
|
var collision = space.intersect_ray(ray)
|
||||||
|
|
||||||
if collision != {} and collision["collider"] is Player:
|
if collision != {} and collision["collider"] is Player:
|
||||||
collision["collider"].take_damage.rpc_id(int(collision["collider"].name),damage)
|
collision["collider"].take_damage.rpc_id(int(collision["collider"].name),damage)
|
||||||
|
|
||||||
|
|
|
||||||
31
scripts/weapon_system/knife/knife_attack.gd
Normal file
31
scripts/weapon_system/knife/knife_attack.gd
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
extends WeaponState
|
||||||
|
|
||||||
|
@export var damage: int
|
||||||
|
var end_it: bool = true
|
||||||
|
|
||||||
|
func enter() -> void:
|
||||||
|
machine.animation_player.play(machine.animation_prefix + "attack")
|
||||||
|
attack()
|
||||||
|
machine.animation_player.animation_finished.connect(on_animation_finished)
|
||||||
|
|
||||||
|
func exit() -> void:
|
||||||
|
machine.animation_player.animation_finished.disconnect(on_animation_finished)
|
||||||
|
end_it = false
|
||||||
|
|
||||||
|
func attack() -> void:
|
||||||
|
if is_multiplayer_authority():
|
||||||
|
Session.shoot(damage,1.5)
|
||||||
|
|
||||||
|
func on_animation_finished(animation):
|
||||||
|
if animation == machine.animation_prefix + "attack":
|
||||||
|
if end_it:
|
||||||
|
transition.emit("Idle")
|
||||||
|
else:
|
||||||
|
attack()
|
||||||
|
machine.animation_player.play(machine.animation_prefix + "attack")
|
||||||
|
|
||||||
|
func use_begin() -> void:
|
||||||
|
end_it = false
|
||||||
|
|
||||||
|
func use_end() -> void:
|
||||||
|
end_it = true
|
||||||
1
scripts/weapon_system/knife/knife_attack.gd.uid
Normal file
1
scripts/weapon_system/knife/knife_attack.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://d0r2fu21ei4hy
|
||||||
19
scripts/weapon_system/knife/knife_attack_heavy.gd
Normal file
19
scripts/weapon_system/knife/knife_attack_heavy.gd
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
extends WeaponState
|
||||||
|
|
||||||
|
@export var damage: int
|
||||||
|
|
||||||
|
func enter() -> void:
|
||||||
|
machine.animation_player.play(machine.animation_prefix + "heavy_attack")
|
||||||
|
machine.animation_player.animation_finished.connect(on_animation_finished)
|
||||||
|
attack()
|
||||||
|
|
||||||
|
func exit() -> void:
|
||||||
|
machine.animation_player.animation_finished.disconnect(on_animation_finished)
|
||||||
|
|
||||||
|
func attack() -> void:
|
||||||
|
if is_multiplayer_authority():
|
||||||
|
Session.shoot(damage,1.5)
|
||||||
|
|
||||||
|
func on_animation_finished(animation):
|
||||||
|
if animation == machine.animation_prefix + "heavy_attack":
|
||||||
|
transition.emit("Idle")
|
||||||
1
scripts/weapon_system/knife/knife_attack_heavy.gd.uid
Normal file
1
scripts/weapon_system/knife/knife_attack_heavy.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://ctx2rjjs48nrc
|
||||||
13
scripts/weapon_system/knife/knife_idle.gd
Normal file
13
scripts/weapon_system/knife/knife_idle.gd
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
extends WeaponState
|
||||||
|
|
||||||
|
func enter() -> void:
|
||||||
|
machine.animation_player.play(machine.animation_prefix + "idle")
|
||||||
|
|
||||||
|
func exit() -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func use_begin() -> void:
|
||||||
|
transition.emit("Attack")
|
||||||
|
|
||||||
|
func alternate_state() -> void:
|
||||||
|
transition.emit("HeavyAttack")
|
||||||
1
scripts/weapon_system/knife/knife_idle.gd.uid
Normal file
1
scripts/weapon_system/knife/knife_idle.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://cn6wyj4v5xeej
|
||||||
12
scripts/weapon_system/knife/knife_intro.gd
Normal file
12
scripts/weapon_system/knife/knife_intro.gd
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
extends WeaponState
|
||||||
|
|
||||||
|
func enter() -> void:
|
||||||
|
machine.animation_player.play(machine.animation_prefix + "intro")
|
||||||
|
machine.animation_player.animation_finished.connect(on_animation_finished)
|
||||||
|
|
||||||
|
func exit() -> void:
|
||||||
|
machine.animation_player.animation_finished.disconnect(on_animation_finished)
|
||||||
|
|
||||||
|
func on_animation_finished(animation):
|
||||||
|
if animation == machine.animation_prefix + "intro":
|
||||||
|
transition.emit("Idle")
|
||||||
1
scripts/weapon_system/knife/knife_intro.gd.uid
Normal file
1
scripts/weapon_system/knife/knife_intro.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://dhmgd83rhjtyq
|
||||||
Loading…
Add table
Add a link
Reference in a new issue