Fix typos and add missing end lines JRPG demo

This commit is contained in:
Nathan Lovato
2018-09-12 10:33:50 +09:00
parent 2709ddeb28
commit 471b813911
12 changed files with 14 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://dialog_system/dialog_player/dialog_player.gd" type="Script" id=1]
[ext_resource path="res://dialog_system/dialog_player/DialogPlayer.gd" type="Script" id=1]
[node name="DialogPlayer" type="Node"]

View File

@@ -1,5 +1,5 @@
{
"dialog_1" : {"name": "Unknown", "text": "Hey, it's a good time to have a JRPG fight, right?"},
"dialog_2" : {"name": "Unknown", "text": "Let me present myself, I'm Opponent"},
"dialog_3" : {"name": "Opponent", "text": "Enough talk, let's fight!"},
"dialog_2" : {"name": "Unknown", "text": "Let me introduce myself, I'm the OPPONENT"},
"dialog_3" : {"name": "Opponent", "text": "Enough talking. Let's fight!"},
}

View File

@@ -1,4 +1,3 @@
{
"dialog_1" : {"name": "Opponent", "text": "Aha! I won, maybe you can try again next time"},
"dialog_2" : {"name": "Opponent", "text": "Now let me wonder around again..."},
}

View File

@@ -1,4 +1,3 @@
{
"dialog_1" : {"name": "Opponent", "text": "Congratulations, you won!"},
"dialog_2" : {"name": "Opponent", "text": "Now let me wonder around again..."},
}

View File

@@ -7,7 +7,6 @@ func _ready():
for child in get_children():
set_cellv(world_to_map(child.position), child.type)
func get_cell_pawn(cell, type = ACTOR):
for node in get_children():
if node.type != type:
@@ -15,7 +14,6 @@ func get_cell_pawn(cell, type = ACTOR):
if world_to_map(node.position) == cell:
return(node)
func request_move(pawn, direction):
var cell_start = world_to_map(pawn.position)
var cell_target = cell_start + direction
@@ -33,4 +31,3 @@ func request_move(pawn, direction):
if not target_pawn.has_node("DialogPlayer"):
return
get_node(dialog_ui).show_dialog(pawn, target_pawn.get_node("DialogPlayer"))

View File

@@ -50,7 +50,7 @@ func add_actor(actor):
actor.position.x += 200 * get_child_count()
add_child(actor)"
[node name="Combat" type="Node2D"]
[node name="Combat" type="Node2D" index="0"]
script = SubResource( 1 )

View File

@@ -2,15 +2,17 @@
[ext_resource path="res://grid_movement/tilesets/grid_lines/grid_lines_tileset.tres" type="TileSet" id=1]
[ext_resource path="res://grid_movement/tilesets/grid/grid_tileset.tres" type="TileSet" id=2]
[ext_resource path="res://grid_movement/grid/grid.gd" type="Script" id=3]
[ext_resource path="res://grid_movement/grid/Grid.gd" type="Script" id=3]
[ext_resource path="res://grid_movement/pawns/Actor.tscn" type="PackedScene" id=4]
[ext_resource path="res://screens/combat/actors/Player.tscn" type="PackedScene" id=5]
[ext_resource path="res://grid_movement/pawns/idle_actor.gd" type="Script" id=6]
[ext_resource path="res://grid_movement/pawns/IdleActor.gd" type="Script" id=6]
[ext_resource path="res://screens/combat/actors/Opponent.tscn" type="PackedScene" id=7]
[ext_resource path="res://dialog_system/dialog_player/DialogPlayer.tscn" type="PackedScene" id=8]
[ext_resource path="res://grid_movement/pawns/pawn.gd" type="Script" id=9]
[ext_resource path="res://dialog_system/interface/DialogUI.tscn" type="PackedScene" id=10]
[node name="Exploration" type="Node2D"]
[node name="Grass" type="TileMap" parent="." index="0"]

View File

@@ -7,10 +7,10 @@ export var life = 0
export var max_life = 10
export var armor = 0
func take_damage(damage):
life = life - damage + armor
if life <= 0:
var applied_damage = max(damage - armor, 0)
life = max(life - applied_damage, 0)
if life == 0:
emit_signal('dead')
else:
emit_signal("health_changed", life)
@@ -21,4 +21,4 @@ func heal(amount):
emit_signal("health_changed", life)
func get_health_ratio():
return life / max_life
return life / max_life

View File

@@ -49,4 +49,4 @@ func set_queue(new_queue):
func _set_active_actor(new_actor):
active_actor = new_actor
active_actor.active = true
emit_signal("active_actor_changed", active_actor)
emit_signal("active_actor_changed", active_actor)