add goblin vs goblin fights, ooze combining and female goblin sprites

This commit is contained in:
fram3d 2024-07-04 17:41:47 +02:00
parent 94e51d3009
commit 16c1857788
Signed by: fram3d
GPG Key ID: 938920E709EEA32A
25 changed files with 206 additions and 5 deletions

View File

@ -0,0 +1,3 @@
source_md5="0bedc1d25bfff077eb5d914e5fe7fa8a"
dest_md5="374fee1e0587a208f29cf85f1eb05c75"

View File

@ -0,0 +1,3 @@
source_md5="4db5daf13756b95d9c203459208e7bec"
dest_md5="7c18b747384a6c7769d1231884831fb7"

View File

@ -0,0 +1,3 @@
source_md5="60deaaf6d89e345ccbdd27a7b0a69080"
dest_md5="b94aec6d467f1ee050e7badffb98610d"

View File

@ -0,0 +1,3 @@
source_md5="2184eb3cff7df95cd01dcc9b94756557"
dest_md5="185a0384fd8901adb5c098cb99e4bc0a"

Binary file not shown.

View File

@ -0,0 +1,15 @@
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/goblinvsgoblin.ogg-7247a807efb05a6b9f4125abfb71486c.oggstr"
[deps]
source_file="res://Audio/Hits/goblinvsgoblin.ogg"
dest_files=[ "res://.import/goblinvsgoblin.ogg-7247a807efb05a6b9f4125abfb71486c.oggstr" ]
[params]
loop=false
loop_offset=0

BIN
src/NPCs/childgoblin.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/childgoblin.png-52693613a47c98bbd4848f6fe1ef405e.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://NPCs/childgoblin.png"
dest_files=[ "res://.import/childgoblin.png-52693613a47c98bbd4848f6fe1ef405e.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -24,6 +24,7 @@ func _physics_process(_delta):
age = age + 1
if pregnancy == 100:
$goblin.texture = load("res://NPCs/femalegoblin.png")
pregnancy = 0
var female = load("res://NPCs/femalegoblin.tscn")
var male = load("res://NPCs/malegoblin.tscn")
@ -47,6 +48,7 @@ func _on_death_finished():
func _on_Romance_area_entered(area):
if area.is_in_group("malegoblin") and pregnancy == 0 and age > 2500:
pregnancy = 1
$goblin.texture = load("res://NPCs/pregnantgoblin.png")
func find_free_position(start, skip = 0):
var direction = randi() % 4

BIN
src/NPCs/femalegoblin.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/femalegoblin.png-f44fc70f53f37230a14ae479b9f64794.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://NPCs/femalegoblin.png"
dest_files=[ "res://.import/femalegoblin.png-f44fc70f53f37230a14ae479b9f64794.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

View File

@ -1,6 +1,6 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://NPCs/goblin.png" type="Texture" id=1]
[ext_resource path="res://NPCs/femalegoblin.png" type="Texture" id=1]
[ext_resource path="res://Audio/Hits/goblininjured.ogg" type="AudioStream" id=2]
[ext_resource path="res://NPCs/femalegoblin.gd" type="Script" id=3]

View File

@ -30,3 +30,11 @@ func _on_Hurtbox_area_entered(_area):
func _on_death_finished():
queue_free()
func _on_Romance_area_entered(area):
if area.is_in_group("malegoblin"):
if randi() % 100 < 20:
$Romance/fight.play()
func _on_fight_finished():
queue_free()

View File

@ -1,8 +1,9 @@
[gd_scene load_steps=8 format=2]
[gd_scene load_steps=9 format=2]
[ext_resource path="res://NPCs/goblin.png" type="Texture" id=1]
[ext_resource path="res://Audio/Hits/goblininjured.ogg" type="AudioStream" id=2]
[ext_resource path="res://NPCs/malegoblin.gd" type="Script" id=3]
[ext_resource path="res://Audio/Hits/goblinvsgoblin.ogg" type="AudioStream" id=4]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 3.90875, 3.7602 )
@ -59,7 +60,12 @@ shape = SubResource( 3 )
collision_layer = 128
collision_mask = 128
[node name="fight" type="AudioStreamPlayer" parent="Romance"]
stream = ExtResource( 4 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Romance"]
shape = SubResource( 4 )
[connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"]
[connection signal="finished" from="Hurtbox/death" to="." method="_on_death_finished"]
[connection signal="area_entered" from="Romance" to="." method="_on_Romance_area_entered"]
[connection signal="finished" from="Romance/fight" to="." method="_on_fight_finished"]

View File

@ -50,3 +50,16 @@ func find_free_position(start, skip = 0):
direction = (direction + 1) % 4
pos = start + MOVEMENT_VECTORS[direction]*11
return pos
func _on_Romance_area_entered(area):
if immunity == 0:
# Ooze with smaller ID creates bigger ooze
if get_instance_id() < area.get_parent().get_instance_id() :
yield(get_tree().create_timer(2.0),"timeout")
var ooze = load("res://NPCs/big_ooze.tscn")
var instance = ooze.instance()
instance.position = position
rootnode.add_child(instance)
queue_free()

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=7 format=2]
[gd_scene load_steps=8 format=2]
[ext_resource path="res://NPCs/ooze.png" type="Texture" id=1]
[ext_resource path="res://NPCs/ooze.gd" type="Script" id=2]
@ -13,6 +13,9 @@ extents = Vector2( 5, 5 )
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 5, 5 )
[sub_resource type="RectangleShape2D" id=4]
extents = Vector2( 6.05606, 6.68265 )
[node name="ooze" type="KinematicBody2D"]
script = ExtResource( 2 )
@ -49,6 +52,14 @@ stream = ExtResource( 3 )
"ooze",
]]
shape = SubResource( 3 )
[node name="Romance" type="Area2D" parent="."]
collision_layer = 2147484672
collision_mask = 1024
[node name="CollisionShape2D" type="CollisionShape2D" parent="Romance"]
shape = SubResource( 4 )
[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"]
[connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"]
[connection signal="finished" from="Hurtbox/death" to="." method="_on_death_finished"]
[connection signal="area_entered" from="Romance" to="." method="_on_Romance_area_entered"]

BIN
src/NPCs/pregnantgoblin.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/pregnantgoblin.png-e12305e67719f26568156597e178b74d.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://NPCs/pregnantgoblin.png"
dest_files=[ "res://.import/pregnantgoblin.png-e12305e67719f26568156597e178b74d.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -35,3 +35,16 @@ func _on_Hitbox_area_entered(_area):
rootnode.add_child(instance)
queue_free()
func _on_Romance_area_entered(area):
if immunity == 0:
# Ooze with smaller ID creates bigger ooze
if get_instance_id() < area.get_parent().get_instance_id() :
yield(get_tree().create_timer(2.0),"timeout")
var ooze = load("res://NPCs/ooze.tscn")
var instance = ooze.instance()
instance.position = position
rootnode.add_child(instance)
queue_free()

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=7 format=2]
[gd_scene load_steps=8 format=2]
[ext_resource path="res://NPCs/ooze.png" type="Texture" id=1]
[ext_resource path="res://NPCs/smallooze.gd" type="Script" id=2]
@ -13,6 +13,9 @@ extents = Vector2( 2.59128, 2.50916 )
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 2.51253, 2.35167 )
[sub_resource type="RectangleShape2D" id=4]
extents = Vector2( 3.8512, 3.69034 )
[node name="small_ooze" type="KinematicBody2D"]
script = ExtResource( 2 )
@ -51,6 +54,14 @@ stream = ExtResource( 3 )
]]
position = Vector2( -0.0787458, 0.0787449 )
shape = SubResource( 3 )
[node name="Romance" type="Area2D" parent="."]
collision_layer = 2048
collision_mask = 2048
[node name="CollisionShape2D" type="CollisionShape2D" parent="Romance"]
shape = SubResource( 4 )
[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"]
[connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"]
[connection signal="finished" from="Hurtbox/death" to="." method="_on_death_finished"]
[connection signal="area_entered" from="Romance" to="." method="_on_Romance_area_entered"]

View File

@ -222,7 +222,6 @@ position = Vector2( 132, 132 )
current = true
zoom = Vector2( 4, 4 )
script = ExtResource( 8 )
max_zoom = 8.0
[node name="Tween" type="Tween" parent="Camera2D"]