Add handcannon; need inventory system and the like to get it working properly
This commit is contained in:
parent
adc96042a3
commit
c6da8d31ea
6 changed files with 113 additions and 26 deletions
15
scenes/inhands/basic_handcannon.tscn
Normal file
15
scenes/inhands/basic_handcannon.tscn
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
[gd_scene format=3 uid="uid://ckfc4q1dbtli8"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://5mkyjoxmci5a" path="res://textures/weapons/inhands/basic_handcannon.png" id="1_fig3b"]
|
||||||
|
|
||||||
|
[node name="Handcannon" type="Node3D" unique_id=523683834]
|
||||||
|
transform = Transform3D(1, -7.642742e-15, -8.7422784e-08, 0, 1, -8.742278e-08, 8.7422784e-08, 8.742278e-08, 1, 0, 0, 0)
|
||||||
|
|
||||||
|
[node name="Handcannon" type="Sprite3D" parent="." unique_id=1764590626]
|
||||||
|
transform = Transform3D(4.3711374e-08, -1, 8.7422755e-08, -1, -4.371136e-08, 1.748456e-07, -1.7484558e-07, -8.742276e-08, -1, 0, 0, 0)
|
||||||
|
offset = Vector2(-6, 5)
|
||||||
|
pixel_size = 0.03
|
||||||
|
shaded = true
|
||||||
|
alpha_cut = 2
|
||||||
|
texture_filter = 0
|
||||||
|
texture = ExtResource("1_fig3b")
|
||||||
15
scenes/projectiles/bullet.tscn
Normal file
15
scenes/projectiles/bullet.tscn
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
[gd_scene format=3 uid="uid://ufm8kssdh8vx"]
|
||||||
|
|
||||||
|
[node name="Bullet" type="Node3D" unique_id=1536641450]
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="CSGCylinder3D" parent="." unique_id=1706082204]
|
||||||
|
transform = Transform3D(4.371139e-08, -1, 8.742278e-08, -1, -4.371139e-08, 0, 3.821371e-15, -8.742278e-08, -1, 0, 0, 0)
|
||||||
|
radius = 0.05
|
||||||
|
sides = 5
|
||||||
|
smooth_faces = false
|
||||||
|
|
||||||
|
[node name="Hit" type="RayCast3D" parent="." unique_id=10285465]
|
||||||
|
transform = Transform3D(-4.371139e-08, 1, -2.9802322e-08, 0, 2.9802322e-08, 1, 1, 4.371139e-08, -1.3027009e-15, 0, 0, 0)
|
||||||
|
target_position = Vector3(0, -500, 0)
|
||||||
|
collision_mask = 19
|
||||||
|
debug_shape_custom_color = Color(0, 1, 0, 1)
|
||||||
|
|
@ -76,13 +76,25 @@ const weapons = {
|
||||||
"attack_swooshy": "pierce",
|
"attack_swooshy": "pierce",
|
||||||
"attack_swooshy_scale": Vector3(1.5, 1, 1),
|
"attack_swooshy_scale": Vector3(1.5, 1, 1),
|
||||||
},
|
},
|
||||||
|
"basic_handcannon": {
|
||||||
|
"ranged_weapon": true,
|
||||||
|
"damage": 100,
|
||||||
|
"max_pierces": 3,
|
||||||
|
"knockback": 2.5,
|
||||||
|
"recharge_time": 15,
|
||||||
|
"bullet": preload("res://scenes/projectiles/bullet.tscn"),
|
||||||
|
|
||||||
|
"attack_swooshy": "pierce",
|
||||||
|
"attack_swooshy_scale": Vector3(1.5, 1, 1),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const inhands = {
|
const inhands = {
|
||||||
"basic_sword": preload("res://scenes/inhands/basic_sword.tscn"),
|
"basic_sword": preload("res://scenes/inhands/basic_sword.tscn"),
|
||||||
"basic_hammer": preload("res://scenes/inhands/basic_hammer.tscn"),
|
"basic_hammer": preload("res://scenes/inhands/basic_hammer.tscn"),
|
||||||
"basic_knife": preload("res://scenes/inhands/basic_knife.tscn"),
|
"basic_knife": preload("res://scenes/inhands/basic_knife.tscn"),
|
||||||
"basic_spear": preload("res://scenes/inhands/basic_spear.tscn")
|
"basic_spear": preload("res://scenes/inhands/basic_spear.tscn"),
|
||||||
|
"basic_handcannon": preload("res://scenes/inhands/basic_handcannon.tscn")
|
||||||
}
|
}
|
||||||
|
|
||||||
const effects = {
|
const effects = {
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,9 @@ func set_weapon(weapon_name: String = "basic_sword") -> void:
|
||||||
$DreamerBody.set_inhand(current_weapon)
|
$DreamerBody.set_inhand(current_weapon)
|
||||||
|
|
||||||
var range = get_weapon_info(current_weapon, "range")
|
var range = get_weapon_info(current_weapon, "range")
|
||||||
|
if not range: range = 1
|
||||||
var width = get_weapon_info(current_weapon, "width")
|
var width = get_weapon_info(current_weapon, "width")
|
||||||
|
if not width: width = 1
|
||||||
|
|
||||||
$HitCollision/Shape.shape.size = Vector3(range, 1.0, width)
|
$HitCollision/Shape.shape.size = Vector3(range, 1.0, width)
|
||||||
|
|
||||||
|
|
@ -229,6 +231,9 @@ func _process(delta: float) -> void:
|
||||||
|
|
||||||
combo_hits = 0
|
combo_hits = 0
|
||||||
|
|
||||||
|
if get_my_weapon_info("ranged_weapon"):
|
||||||
|
pass
|
||||||
|
else:
|
||||||
for body in hits:
|
for body in hits:
|
||||||
if body == self: continue
|
if body == self: continue
|
||||||
|
|
||||||
|
|
|
||||||
BIN
textures/weapons/inhands/basic_handcannon.png
Normal file
BIN
textures/weapons/inhands/basic_handcannon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 377 B |
40
textures/weapons/inhands/basic_handcannon.png.import
Normal file
40
textures/weapons/inhands/basic_handcannon.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://5mkyjoxmci5a"
|
||||||
|
path="res://.godot/imported/basic_handcannon.png-c376938e89f18e9233b6832e9644fa6c.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://textures/weapons/inhands/basic_handcannon.png"
|
||||||
|
dest_files=["res://.godot/imported/basic_handcannon.png-c376938e89f18e9233b6832e9644fa6c.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
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=false
|
||||||
|
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
|
||||||
Loading…
Reference in a new issue