More work on implementing quests and tech trees
This commit is contained in:
@@ -19,10 +19,6 @@ enum Locations{
|
||||
}
|
||||
|
||||
class Event:
|
||||
var enemy_types: Dictionary[String, PackedScene] = {
|
||||
"feral pig": preload("res://templates/enemies/feral_pig.tscn"),
|
||||
"goo": preload("res://templates/enemies/goo.tscn")
|
||||
}
|
||||
enum Type{
|
||||
WAIT,
|
||||
COMBAT,
|
||||
@@ -73,7 +69,7 @@ class Event:
|
||||
combat_state = CombatState.FIGHTING
|
||||
var enemy_list = []
|
||||
for enemy_name in enemies:
|
||||
enemy_list.append(enemy_types[enemy_name].instantiate())
|
||||
enemy_list.append(Enemy.list[enemy_name].instantiate())
|
||||
quest.questview.set_questor_animation("idle")
|
||||
for enemy in enemy_list:
|
||||
enemy.flip_h()
|
||||
|
||||
BIN
external/glowing-line.png
vendored
Normal file
BIN
external/glowing-line.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 820 B |
40
external/glowing-line.png.import
vendored
Normal file
40
external/glowing-line.png.import
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dck0g2dl7vbcr"
|
||||
path="res://.godot/imported/glowing-line.png-71ab75e25179832dabf598a26bfa404d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://external/glowing-line.png"
|
||||
dest_files=["res://.godot/imported/glowing-line.png-71ab75e25179832dabf598a26bfa404d.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=1
|
||||
@@ -120,5 +120,4 @@ behavior_tree/behavior_tree_default_dir="res://demo/ai/trees"
|
||||
[rendering]
|
||||
|
||||
textures/canvas_textures/default_texture_filter=0
|
||||
renderer/rendering_method="gl_compatibility"
|
||||
renderer/rendering_method.mobile="gl_compatibility"
|
||||
viewport/hdr_2d=true
|
||||
|
||||
17
scripts/employee_panel.gd
Normal file
17
scripts/employee_panel.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
extends PanelContainer
|
||||
|
||||
var employee : GuildEmployee
|
||||
|
||||
func setup(employee : GuildEmployee) -> void:
|
||||
self.employee = employee
|
||||
global_position = Vector2(get_viewport().get_mouse_position()) - size / 2
|
||||
return
|
||||
|
||||
func display_develop_tree() -> void:
|
||||
pass
|
||||
|
||||
func _on_develop_button_pressed() -> void:
|
||||
display_develop_tree()
|
||||
|
||||
func _on_focus_exited() -> void:
|
||||
queue_free()
|
||||
1
scripts/employee_panel.gd.uid
Normal file
1
scripts/employee_panel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://pwj0ai6mg7o2
|
||||
@@ -17,6 +17,7 @@ static func load_enemy_list() -> void:
|
||||
dir.list_dir_end()
|
||||
|
||||
|
||||
|
||||
func attack(target : QuestSprite) -> void:
|
||||
print("Attack by %s to %s" % [name, target.name])
|
||||
hitting.connect(hit.bind(target), CONNECT_ONE_SHOT)
|
||||
|
||||
@@ -54,7 +54,10 @@ func toggle_player_profile():
|
||||
|
||||
func start_shift(shift_num) -> void:
|
||||
current_shift = shift_num
|
||||
panel.reset_timer(shifts[shift_num])
|
||||
if len(shifts) < 1:
|
||||
panel.reset_timer(600)
|
||||
else:
|
||||
panel.reset_timer(shifts[shift_num])
|
||||
|
||||
func end_shift() -> void:
|
||||
take_screenshot()
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
class_name GuildEmployee extends AdventurerSprite
|
||||
|
||||
const employee_panel_template = preload("res://templates/employee_panel.tscn")
|
||||
|
||||
@export var speech :String
|
||||
@onready var queue : GuildQueue = $Queue
|
||||
|
||||
@@ -10,3 +12,14 @@ func interact(interactor, type : String = "") -> void:
|
||||
Guild.register_guild_member(interactor.data, true)
|
||||
#interactor.advance_
|
||||
service_provided.emit()
|
||||
|
||||
|
||||
func _on_mouse_area_input_event(viewport: Node, event: InputEvent, shape_idx: int) -> void:
|
||||
if event is not InputEventMouseButton:
|
||||
return
|
||||
var evt = event as InputEventMouseButton
|
||||
if evt.button_index == MOUSE_BUTTON_RIGHT:
|
||||
var emp_panel : PanelContainer = employee_panel_template.instantiate()
|
||||
get_tree().root.add_child(emp_panel)
|
||||
emp_panel.setup(self)
|
||||
emp_panel.grab_focus()
|
||||
|
||||
@@ -50,7 +50,7 @@ func _physics_process(delta: float) -> void:
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
var evt : InputEventMouseButton = event as InputEventMouseButton
|
||||
if evt and evt.pressed:
|
||||
if evt and evt.button_index == MOUSE_BUTTON_LEFT and evt.pressed:
|
||||
approach(evt.global_position)
|
||||
nav_agent.target_desired_distance = stop_range
|
||||
interaction_target = null
|
||||
|
||||
13
shaders/glowing_line.gdshader
Normal file
13
shaders/glowing_line.gdshader
Normal file
@@ -0,0 +1,13 @@
|
||||
// NOTE: Shader automatically converted from Godot Engine 4.5.1.stable.mono's CanvasItemMaterial.
|
||||
|
||||
shader_type canvas_item;
|
||||
render_mode blend_mix;
|
||||
uniform sampler2D main_texture;
|
||||
|
||||
void vertex() {
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec4 col = texture(main_texture, UV);
|
||||
COLOR = col;
|
||||
}
|
||||
1
shaders/glowing_line.gdshader.uid
Normal file
1
shaders/glowing_line.gdshader.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cm3u77icj5agh
|
||||
94
templates/employee_develop_tree.tscn
Normal file
94
templates/employee_develop_tree.tscn
Normal file
@@ -0,0 +1,94 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dv4pmw8f0qr3i"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_dkoub"]
|
||||
ambient_light_source = 1
|
||||
reflected_light_source = 1
|
||||
glow_enabled = true
|
||||
glow_intensity = 8.0
|
||||
glow_strength = 2.0
|
||||
glow_bloom = 1.0
|
||||
|
||||
[sub_resource type="Shader" id="Shader_dkoub"]
|
||||
code = "// NOTE: Shader automatically converted from Godot Engine 4.5.1.stable.mono's CanvasItemMaterial.
|
||||
|
||||
shader_type canvas_item;
|
||||
render_mode blend_mix;
|
||||
uniform sampler2D main_texture;
|
||||
|
||||
void vertex() {
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec4 col = texture(main_texture, UV);
|
||||
COLOR = col;
|
||||
}"
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_000fu"]
|
||||
shader = SubResource("Shader_dkoub")
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_dkoub")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 800.0
|
||||
offset_bottom = 427.0
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/PanelContainer"]
|
||||
layout_mode = 2
|
||||
text = "Development Options"
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(800, 400)
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 5
|
||||
theme_override_constants/margin_right = 5
|
||||
theme_override_constants/margin_bottom = 5
|
||||
|
||||
[node name="Container" type="Control" parent="PanelContainer/VBoxContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Button" type="Button" parent="PanelContainer/VBoxContainer/MarginContainer/Container"]
|
||||
layout_mode = 0
|
||||
offset_top = 152.0
|
||||
offset_right = 97.0
|
||||
offset_bottom = 183.0
|
||||
text = "Sign-up List"
|
||||
|
||||
[node name="Button2" type="Button" parent="PanelContainer/VBoxContainer/MarginContainer/Container"]
|
||||
layout_mode = 0
|
||||
offset_left = 189.0
|
||||
offset_top = 152.0
|
||||
offset_right = 340.0
|
||||
offset_bottom = 183.0
|
||||
text = "Roster Sheet"
|
||||
|
||||
[node name="Button3" type="Button" parent="PanelContainer/VBoxContainer/MarginContainer/Container"]
|
||||
layout_mode = 0
|
||||
offset_left = 412.0
|
||||
offset_top = 151.0
|
||||
offset_right = 559.0
|
||||
offset_bottom = 182.0
|
||||
text = "Roster Book"
|
||||
|
||||
[node name="Line2D" type="Line2D" parent="PanelContainer/VBoxContainer/MarginContainer/Container"]
|
||||
material = SubResource("ShaderMaterial_000fu")
|
||||
position = Vector2(101, 168)
|
||||
points = PackedVector2Array(0, 0, 84, 0)
|
||||
width = 3.0
|
||||
begin_cap_mode = 2
|
||||
antialiased = true
|
||||
34
templates/employee_panel.tscn
Normal file
34
templates/employee_panel.tscn
Normal file
@@ -0,0 +1,34 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://ejiv2wdgeeva"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://pwj0ai6mg7o2" path="res://scripts/employee_panel.gd" id="1_ls6g8"]
|
||||
|
||||
[node name="Employee Panel" type="PanelContainer"]
|
||||
offset_right = 126.0
|
||||
offset_bottom = 70.0
|
||||
focus_mode = 1
|
||||
script = ExtResource("1_ls6g8")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/PanelContainer"]
|
||||
layout_mode = 2
|
||||
text = "Employee Name"
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 3
|
||||
theme_override_constants/margin_top = 4
|
||||
theme_override_constants/margin_right = 4
|
||||
theme_override_constants/margin_bottom = 0
|
||||
|
||||
[node name="DevelopButton" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Develop"
|
||||
|
||||
[connection signal="focus_exited" from="." to="." method="_on_focus_exited"]
|
||||
[connection signal="pressed" from="VBoxContainer/DevelopButton" to="." method="_on_develop_button_pressed"]
|
||||
@@ -257,3 +257,9 @@ offset_bottom = 22.0
|
||||
text = "Feral Pig"
|
||||
horizontal_alignment = 1
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Button" type="Button" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 8.0
|
||||
offset_bottom = 8.0
|
||||
toggle_mode = true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://cf6nnjyp8kv78"]
|
||||
[gd_scene load_steps=9 format=3 uid="uid://cf6nnjyp8kv78"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b2unuudq5qfl" path="res://scripts/guild_employee.gd" id="1_vwytd"]
|
||||
[ext_resource type="Texture2D" uid="uid://nrhxsevqn82" path="res://graphics/receptionist.png" id="2_dlmqr"]
|
||||
@@ -12,6 +12,10 @@ height = 54.0
|
||||
|
||||
[sub_resource type="BlackboardPlan" id="BlackboardPlan_xsrct"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_51mum"]
|
||||
radius = 29.0
|
||||
height = 108.0
|
||||
|
||||
[node name="Receptionist" type="CharacterBody2D"]
|
||||
script = ExtResource("1_vwytd")
|
||||
|
||||
@@ -38,3 +42,12 @@ position = Vector2(44, -93)
|
||||
[node name="BTPlayer" type="BTPlayer" parent="."]
|
||||
behavior_tree = ExtResource("7_qmbsn")
|
||||
blackboard_plan = SubResource("BlackboardPlan_xsrct")
|
||||
|
||||
[node name="MouseArea" type="Area2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="MouseArea"]
|
||||
position = Vector2(0, -50)
|
||||
shape = SubResource("CapsuleShape2D_51mum")
|
||||
debug_color = Color(0.19833331, 0.7, 0, 0.41960785)
|
||||
|
||||
[connection signal="input_event" from="MouseArea" to="." method="_on_mouse_area_input_event"]
|
||||
|
||||
Reference in New Issue
Block a user