Compare commits

...

4 Commits

Author SHA1 Message Date
ncusimano d227d15ed3 Cultist Works! 2023-08-20 15:03:09 -06:00
ncusimano bbb160cd40 Merge branch 'master' into NoahBackup-08-20-1.22PM 2023-08-20 15:02:53 -06:00
vengefulcartographer 264a029cbd Merge branch 'master' of https://git.sjkillen.ca/sjkillen/ABGJ-23 2023-08-20 13:32:04 -06:00
vengefulcartographer 8c9ba03def new environment 2023-08-20 13:31:48 -06:00
11 changed files with 139 additions and 47 deletions

View File

@ -1,12 +1,9 @@
[gd_scene load_steps=7 format=3 uid="uid://cdm267rtmop75"] [gd_scene load_steps=6 format=3 uid="uid://cdm267rtmop75"]
[ext_resource type="PackedScene" uid="uid://c4s6y758n77lw" path="res://villager_shared.tscn" id="1_6uu34"]
[ext_resource type="PackedScene" uid="uid://7utef1nnena8" path="res://player.tscn" id="1_jbc4n"] [ext_resource type="PackedScene" uid="uid://7utef1nnena8" path="res://player.tscn" id="1_jbc4n"]
[ext_resource type="PackedScene" uid="uid://dl4g083w17qh1" path="res://villager.tscn" id="2_i3gws"]
[ext_resource type="PackedScene" uid="uid://e0s4phx2jiit" path="res://cultist.tscn" id="3_renxb"] [ext_resource type="PackedScene" uid="uid://e0s4phx2jiit" path="res://cultist.tscn" id="3_renxb"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_62oje"]
radius = 10.0
[sub_resource type="CylinderMesh" id="CylinderMesh_c2b6h"] [sub_resource type="CylinderMesh" id="CylinderMesh_c2b6h"]
top_radius = 80.23 top_radius = 80.23
@ -15,33 +12,23 @@ data = PackedVector3Array(0, 1, 80.23, 7.8639, 1, 79.8437, 0, 0.6, 64.284, 7.863
[node name="Node3D" type="Node3D"] [node name="Node3D" type="Node3D"]
[node name="Player" parent="." instance=ExtResource("1_jbc4n")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -24, 5, 40)
[node name="StaticBody3D" type="StaticBody3D" parent="."]
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
shape = SubResource("CylinderShape3D_62oje")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] [node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -0.523317, 0.852138, 0, -0.852138, -0.523317, 0, 10.6239, 0) transform = Transform3D(1, 0, 0, 0, -0.523317, 0.852138, 0, -0.852138, -0.523317, 0, 10.6239, 0)
[node name="Node3D" parent="." instance=ExtResource("2_i3gws")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -22, 3, 43)
[node name="Node3D2" parent="." instance=ExtResource("3_renxb")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 29, 4, 33)
walk_chance = 0.1
spin_chance = 0.2
walk_speed = 0.5
dir_correction_rate = 0.95
dir_accuracy = 0.00174533
[node name="MeshInstance3D" type="MeshInstance3D" parent="."] [node name="MeshInstance3D" type="MeshInstance3D" parent="."]
mesh = SubResource("CylinderMesh_c2b6h") mesh = SubResource("CylinderMesh_c2b6h")
skeleton = NodePath("../StaticBody3D/CollisionShape3D") skeleton = NodePath("")
[node name="StaticBody3D" type="StaticBody3D" parent="MeshInstance3D"] [node name="StaticBody3D" type="StaticBody3D" parent="MeshInstance3D"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="MeshInstance3D/StaticBody3D"] [node name="CollisionShape3D" type="CollisionShape3D" parent="MeshInstance3D/StaticBody3D"]
shape = SubResource("ConcavePolygonShape3D_8q044") shape = SubResource("ConcavePolygonShape3D_8q044")
[node name="villager" parent="." instance=ExtResource("1_6uu34")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.28115, 0)
[node name="Cultist" parent="." instance=ExtResource("3_renxb")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.87818, 2, 0.191837)
[node name="Player" parent="." instance=ExtResource("1_jbc4n")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.140476, 0.999999, 1.27725)

View File

@ -0,0 +1,52 @@
[gd_scene load_steps=7 format=3 uid="uid://6ycop5t3nra5"]
[ext_resource type="Texture2D" uid="uid://6k4ialfiwfxe" path="res://Textures/blueskygradient.jpg" id="1_l2fuq"]
[sub_resource type="PhysicalSkyMaterial" id="PhysicalSkyMaterial_jvebd"]
turbidity = 50.0
sun_disk_scale = 0.5
ground_color = Color(0, 0, 0, 1)
night_sky = ExtResource("1_l2fuq")
[sub_resource type="Sky" id="Sky_ummxe"]
sky_material = SubResource("PhysicalSkyMaterial_jvebd")
[sub_resource type="Environment" id="Environment_d42bf"]
background_mode = 2
background_energy_multiplier = 0.5
sky = SubResource("Sky_ummxe")
[sub_resource type="Animation" id="Animation_l6y5u"]
resource_name = "DayNightCycle"
length = 10.0
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("DirectionalLight3D:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 10),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 0, 0), Vector3(6.28319, 0, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_2t5g8"]
_data = {
"DayNightCycle": SubResource("Animation_l6y5u")
}
[node name="DayNightEnvironment" type="Node3D"]
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_d42bf")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "DayNightCycle"
libraries = {
"": SubResource("AnimationLibrary_2t5g8")
}

View File

@ -154,7 +154,7 @@ transform = Transform3D(0.065, 0, 0, 0, 0.065, 0, 0, 0, 0.065, 0, 0, 0)
script = ExtResource("2_ksje8") script = ExtResource("2_ksje8")
[node name="Skeleton3D" parent="rig" index="0"] [node name="Skeleton3D" parent="rig" index="0"]
bones/0/rotation = Quaternion(0.0838794, 0, 0, 0.996476) bones/0/rotation = Quaternion(0.0933172, 0, 0, 0.995637)
bones/1/rotation = Quaternion(-0.0891896, 1.18734e-07, -1.06322e-08, 0.996015) bones/1/rotation = Quaternion(-0.0891896, 1.18734e-07, -1.06322e-08, 0.996015)
bones/2/rotation = Quaternion(0.0133933, -1.19199e-07, 1.5966e-09, 0.99991) bones/2/rotation = Quaternion(0.0133933, -1.19199e-07, 1.5966e-09, 0.99991)
bones/3/rotation = Quaternion(-0.00997737, 0.100365, -0.694951, 0.711948) bones/3/rotation = Quaternion(-0.00997737, 0.100365, -0.694951, 0.711948)
@ -191,5 +191,5 @@ stream = ExtResource("5_b32re")
[node name="sad" type="AudioStreamPlayer" parent="." index="7"] [node name="sad" type="AudioStreamPlayer" parent="." index="7"]
stream = ExtResource("6_qe4bi") stream = ExtResource("6_qe4bi")
[node name="woohoo" type="AudioStreamPlayer" parent="." index="8"] [node name="soundboard" type="AudioStreamPlayer" parent="." index="8"]
stream = ExtResource("6_qe4bi") stream = ExtResource("6_qe4bi")

BIN
godot/Textures/blueskygradient.jpg (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://6k4ialfiwfxe"
path.s3tc="res://.godot/imported/blueskygradient.jpg-d6c6e0628914c8bb67a152e92adda07d.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Textures/blueskygradient.jpg"
dest_files=["res://.godot/imported/blueskygradient.jpg-d6c6e0628914c8bb67a152e92adda07d.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
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/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

View File

@ -1,8 +1,11 @@
extends SharedSlime
class_name Villager class_name Villager
extends SharedSlime
var color_changes = true var color_changes = true
var is_villager = true
var hp = 100 var hp = 100
var aggressor var aggressor
@ -13,13 +16,16 @@ func _process(delta):
become_corrupted() become_corrupted()
func become_corrupted(): func become_corrupted():
if location_xz.distance_to(aggressor.location_xy) <= 1: if location_xz.distance_to(aggressor.location_xz) <= 1:
print("becoming corrupted")
print(hp)
# Spin for effect and lose hp. # Spin for effect and lose hp.
rotate_y(deg_to_rad(-15)) rotate_y(deg_to_rad(-15))
hp -= 0.5 hp -= 0.5
else: else:
hp = 100 hp = 100
task = "idle" task = "idle"
print("cultist left")
# Create a new cultist and then destroy self. # Create a new cultist and then destroy self.
if hp <= 0: if hp <= 0:
@ -30,8 +36,8 @@ func become_corrupted():
# Load and instantiate a new cultist. # Load and instantiate a new cultist.
var cultist = load("res://cultist.tscn") var cultist = load("res://cultist.tscn")
cultist = cultist.instantiate() cultist = cultist.instantiate()
get_tree().get_root().add_child(cultist) get_parent_node_3d().add_child(cultist)
cultist.location_xz = location_xz cultist.set_global_position(get_global_position())
# Destroy self. # Destroy self.
queue_free() queue_free()
@ -58,6 +64,6 @@ func _on_area_3d_body_entered(body):
func _on_collision_detection_body_entered(body): func _on_collision_detection_body_entered(body):
if body.is_class("Cultist"): if "is_cultist" in body:
aggressor = body aggressor = body as Cultist
task = "become_corrupted" task = "become_corrupted"

View File

@ -1,8 +1,10 @@
extends SharedSlime
class_name Cultist class_name Cultist
extends SharedSlime
var victim var victim
var is_cultist = true
func _process(delta): func _process(delta):
super._process(delta) super._process(delta)
@ -11,23 +13,26 @@ func _process(delta):
func corrupt(): func corrupt():
# Make sure the victim is still next to the cultist. # Make sure the victim is still next to the cultist.
if location_xz.distance_to(victim.location_xy) <= 1 and victim != null: if location_xz.distance_to(victim.location_xz) <= 0.5 and victim != null:
print("corrupting")
rotate_y(deg_to_rad(15)) rotate_y(deg_to_rad(15))
if victim.hp <= 0: if victim.hp <= 0:
$evilslime.play() $evilslime.play()
task = "idle" task = "idle"
else: else:
print("target lost")
task = "idle" task = "idle"
# For corruption detection range. # For corruption detection range.
func _on_target_radius_body_entered(body): func _on_target_radius_body_entered(body):
if body.is_class("Villager"): if "is_villager" in body:
victim = body print("target found")
walk_speed = 2 * walk_speed victim = body as Villager
target_location_xz = victim.location_xz target_location_xz = victim.location_xz
task = "walk" task = "walk"
# For collision with other slimes. # For collision with other slimes.
func _on_collision_detection_body_entered(body): func _on_collision_detection_body_entered(body):
if body.is_class("Villager"): if "is_villager" in body:
task = "corrupt" task = "corrupt"

View File

@ -5,10 +5,10 @@
[ext_resource type="AudioStream" uid="uid://cxadu5w3jwv0b" path="res://Sounds/evilslime.ogg" id="3_novm4"] [ext_resource type="AudioStream" uid="uid://cxadu5w3jwv0b" path="res://Sounds/evilslime.ogg" id="3_novm4"]
[sub_resource type="SphereShape3D" id="SphereShape3D_rypky"] [sub_resource type="SphereShape3D" id="SphereShape3D_rypky"]
radius = 5.0 radius = 2.5
[sub_resource type="SphereShape3D" id="SphereShape3D_pa038"] [sub_resource type="SphereShape3D" id="SphereShape3D_pa038"]
radius = 0.05 radius = 0.055
[sub_resource type="SphereShape3D" id="SphereShape3D_bmc5i"] [sub_resource type="SphereShape3D" id="SphereShape3D_bmc5i"]
radius = 0.05 radius = 0.05
@ -22,13 +22,17 @@ script = ExtResource("1_k6djk")
shape = SubResource("SphereShape3D_rypky") shape = SubResource("SphereShape3D_rypky")
[node name="slime" parent="." instance=ExtResource("2_004fn")] [node name="slime" parent="." instance=ExtResource("2_004fn")]
transform = Transform3D(0.035, 0, 0, 0, 0.035, 0, 0, 0, 0.035, 0, 0, 0)
[node name="CollisionDetection" type="Area3D" parent="."] [node name="CollisionDetection" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.03, 0)
[node name="collision_ range" type="CollisionShape3D" parent="CollisionDetection"] [node name="collision_ range" type="CollisionShape3D" parent="CollisionDetection"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.013, 0)
shape = SubResource("SphereShape3D_pa038") shape = SubResource("SphereShape3D_pa038")
[node name="cultist_collision" type="CollisionShape3D" parent="."] [node name="cultist_collision" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0429018, 0)
shape = SubResource("SphereShape3D_bmc5i") shape = SubResource("SphereShape3D_bmc5i")
[node name="evilslime" type="AudioStreamPlayer3D" parent="."] [node name="evilslime" type="AudioStreamPlayer3D" parent="."]

View File

@ -38,7 +38,7 @@ func walk():
# Rotate towards destination at specified percentage rate. # Rotate towards destination at specified percentage rate.
rotate_y(direction_xz.angle_to(target_direction_xz) * dir_correction_rate) rotate_y(direction_xz.angle_to(target_direction_xz) * dir_correction_rate)
if location_xz.distance_to(target_location_xz) <= (Vector2(direction_xz.x, direction_xz.z) * walk_speed).length(): if location_xz.distance_to(target_location_xz) <= 0.1:
target_direction_xz = direction_xz target_direction_xz = direction_xz
target_location_xz = location_xz target_location_xz = location_xz
task = "idle" task = "idle"
@ -89,7 +89,7 @@ func _physics_process(delta):
velocity.y -= gravity * delta velocity.y -= gravity * delta
# Walk to target location. # Walk to target location.
if (location_xz.distance_to(target_location_xz) > walk_speed) and task == "walk": if (location_xz.distance_to(target_location_xz) >= 0.1) and task == "walk":
velocity.x = direction_xz.x * walk_speed velocity.x = direction_xz.x * walk_speed
velocity.z = direction_xz.z * walk_speed velocity.z = direction_xz.z * walk_speed
else: else:

View File

@ -1,7 +1,6 @@
[gd_scene load_steps=24 format=3 uid="uid://v3vjhyhrqfhi"] [gd_scene load_steps=24 format=3 uid="uid://v3vjhyhrqfhi"]
[ext_resource type="PackedScene" uid="uid://d2d4uv7o5gx5p" path="res://Level/World/screen_shader.tscn" id="1_ee0bf"] [ext_resource type="PackedScene" uid="uid://d2d4uv7o5gx5p" path="res://Level/World/screen_shader.tscn" id="1_ee0bf"]
[ext_resource type="PackedScene" uid="uid://b35w4hlh4n1jt" path="res://Level/World/world_environment.tscn" id="2_wvs0f"]
[ext_resource type="PackedScene" uid="uid://difi2tur2j4dg" path="res://Models/island.tscn" id="3_30dtd"] [ext_resource type="PackedScene" uid="uid://difi2tur2j4dg" path="res://Models/island.tscn" id="3_30dtd"]
[ext_resource type="PackedScene" uid="uid://ctbyl0qbks4k6" path="res://Models/ocean.tscn" id="4_527x8"] [ext_resource type="PackedScene" uid="uid://ctbyl0qbks4k6" path="res://Models/ocean.tscn" id="4_527x8"]
[ext_resource type="PackedScene" uid="uid://d3ccrfjpg4hbv" path="res://Models/palm_curved.tscn" id="5_a3wkm"] [ext_resource type="PackedScene" uid="uid://d3ccrfjpg4hbv" path="res://Models/palm_curved.tscn" id="5_a3wkm"]
@ -23,13 +22,12 @@
[ext_resource type="PackedScene" uid="uid://bgoo1lbt28na" path="res://Models/grape_man.tscn" id="21_j8hpq"] [ext_resource type="PackedScene" uid="uid://bgoo1lbt28na" path="res://Models/grape_man.tscn" id="21_j8hpq"]
[ext_resource type="PackedScene" uid="uid://c3q6fva1c1baa" path="res://Models/slime.tscn" id="22_f6psl"] [ext_resource type="PackedScene" uid="uid://c3q6fva1c1baa" path="res://Models/slime.tscn" id="22_f6psl"]
[ext_resource type="PackedScene" uid="uid://7utef1nnena8" path="res://player.tscn" id="23_bmfvv"] [ext_resource type="PackedScene" uid="uid://7utef1nnena8" path="res://player.tscn" id="23_bmfvv"]
[ext_resource type="PackedScene" uid="uid://6ycop5t3nra5" path="res://Level/World/DayNightEnvironment.tscn" id="23_enwwy"]
[node name="World" type="Node3D"] [node name="World" type="Node3D"]
[node name="ScreenShader" parent="." instance=ExtResource("1_ee0bf")] [node name="ScreenShader" parent="." instance=ExtResource("1_ee0bf")]
[node name="WorldEnvironment" parent="." instance=ExtResource("2_wvs0f")]
[node name="island" parent="." instance=ExtResource("3_30dtd")] [node name="island" parent="." instance=ExtResource("3_30dtd")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
@ -257,3 +255,5 @@ transform = Transform3D(1, 0, 0, 0, 0.965509, 0.26037, 0, -0.26037, 0.965509, 0,
[node name="Player" parent="." instance=ExtResource("23_bmfvv")] [node name="Player" parent="." instance=ExtResource("23_bmfvv")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.548558, 2.93052, 0.413536) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.548558, 2.93052, 0.413536)
[node name="DayNightEnvironment" parent="." instance=ExtResource("23_enwwy")]

View File

@ -4,7 +4,7 @@
[ext_resource type="Script" path="res://Villager.gd" id="2_uf6mh"] [ext_resource type="Script" path="res://Villager.gd" id="2_uf6mh"]
[sub_resource type="SphereShape3D" id="SphereShape3D_k5rhc"] [sub_resource type="SphereShape3D" id="SphereShape3D_k5rhc"]
radius = 0.05 radius = 0.055
[sub_resource type="SphereShape3D" id="SphereShape3D_wx128"] [sub_resource type="SphereShape3D" id="SphereShape3D_wx128"]
radius = 0.1 radius = 0.1