Skip to content

Commit

Permalink
Merge pull request #52 from rafaelcastrocouto/main
Browse files Browse the repository at this point in the history
v0.3
  • Loading branch information
rafaelcastrocouto authored Sep 8, 2022
2 parents 031ddce + e50e56e commit d0ec459
Show file tree
Hide file tree
Showing 78 changed files with 718 additions and 690 deletions.
Binary file modified prototype/assets/buildings/buildings_blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified prototype/assets/buildings/buildings_gray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified prototype/assets/buildings/buildings_red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified prototype/assets/buildings/neutral_blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified prototype/assets/buildings/neutral_gray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified prototype/assets/buildings/neutral_red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified prototype/assets/map/trees.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added prototype/assets/ui/minimap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added prototype/assets/waterfall/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed prototype/assets/waterfall/behind-fall.png
Binary file not shown.
Binary file removed prototype/assets/waterfall/foliage_foreground.png
Binary file not shown.
Binary file removed prototype/assets/waterfall/fore-fall.png
Binary file not shown.
Binary file added prototype/assets/waterfall/forefall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added prototype/assets/waterfall/foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed prototype/assets/waterfall/front_rock.png
Binary file not shown.
Binary file removed prototype/assets/waterfall/grass.png
Binary file not shown.
Binary file removed prototype/assets/waterfall/left-bg.png
Binary file not shown.
Binary file removed prototype/assets/waterfall/log_0-export.png
Binary file not shown.
Binary file removed prototype/assets/waterfall/mask.png
Binary file not shown.
Binary file modified prototype/assets/waterfall/rock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added prototype/assets/waterfall/stuck_sword.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added prototype/assets/waterfall/stuck_sword_mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed prototype/assets/waterfall/sword.png
Binary file not shown.
Binary file added prototype/assets/waterfall/swords.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion prototype/buildings/castle.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ radius = 60.0
radius = 250.0

[node name="castle" instance=ExtResource( 1 )]
hp = 4000
hp = 2400
regen = 10
vision = 320
type = "building"
Expand Down
5 changes: 1 addition & 4 deletions prototype/controls/camera.gd
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,19 @@ func focus_leader(index):

func zoom_reset():
zoom = zoom_default
game.ui.show_all()
game.ui.minimap.corner_view()
game.unit.hud.hide_hpbars()


func zoom_in():
zoom = Vector2(zoom_limit.x,zoom_limit.x)
game.ui.hide_all_keep_stats()
game.ui.minimap.corner_view()
game.unit.hud.show_hpbars()


func zoom_out():
zoom = Vector2(zoom_limit.y, zoom_limit.y)
game.ui.hide_all_keep_stats()
game.ui.minimap.hide_view()
game.ui.get_node("top_mid").show()


func process():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extends ItemList
var game:Node

# self = game.ui.controls
# self = game.ui.controls_menu

onready var controls_buttons = get_node("scroll_container/container/controls_buttons")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extends ItemList
var game:Node

# self = game.ui.orders
# self = game.ui.orders_menu

var cleared = false

Expand All @@ -22,7 +22,7 @@ var camp:Array = []
var outpost:Array = []


var button_template:PackedScene = load("res://controls/orders/button/order_button.tscn")
var button_template:PackedScene = load("res://ui/buttons/order_button.tscn")

const order_types = {
"leader_tactics": ["retreat","defend","default","attack"],
Expand Down Expand Up @@ -121,6 +121,7 @@ func build_leaders():
container.add_child(orders_container.node)
leader_orders[leader.name+leader.team] = orders_container
setup_leader_buttons(orders_container)
game.unit.orders.build_leaders()


func setup_leader_buttons(orders_container):
Expand Down
5 changes: 4 additions & 1 deletion prototype/game.gd
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ var control_state = "selection"

var built:bool = false
var started:bool = false
var ended:bool = false

var victory:String


func _ready():
Expand Down Expand Up @@ -75,7 +78,7 @@ func start():

rng.randomize()
maps.setup_lanes()
ui.orders.build()
ui.orders_menu.build()
unit.follow.setup_pathfind()
unit.spawn.choose_leaders()

Expand Down
2 changes: 1 addition & 1 deletion prototype/items/inventories.gd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var enemy_leaders_inv = {}
var enemy_deliveries = {}


var item_button_preload = preload("res://items/button/item_button.tscn")
var item_button_preload = preload("res://ui/buttons/item_button.tscn")
var sell_button_margin = 40


Expand Down
17 changes: 7 additions & 10 deletions prototype/items/shop.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var game:Node

# self = game.ui.shop

var item_button_preload = preload("res://items/button/item_button.tscn")
var item_button_preload = preload("res://ui/buttons/item_button.tscn")
var cleared =false

onready var container = get_node("scroll_container/container")
Expand Down Expand Up @@ -101,28 +101,25 @@ func close_to_blacksmith(leader):
return false



func update_buttons():
if visible:
var leader = game.selected_leader


# disable all buttons if no leader selected or if delivery in proccess
if not leader or game.ui.inventories.is_delivering(leader):
if not leader or game.ui.inventories.is_delivering(leader):
disable_all()
return

# enable/disable all buttons on which leader don't have enough golds
# disable equip if leader is not close to shop
if not close_to_blacksmith(leader):
disable_equip()

# enable/disable buttons on which leader don't have enough golds
var inventory = game.ui.inventories.get_leader_inventory(leader)
if leader and inventory:
for item_button in equip_items.get_children() + consumable_items.get_children():
var item_price = item_button.item.price
item_button.disabled = (leader.gold < item_price)

# disable equip if leader is not close to shop
if not close_to_blacksmith(leader):
disable_equip()

# disable buttons if leader don't have empty slots for item
if leader and inventory:
if !game.ui.inventories.equip_items_has_slots(leader):
Expand Down
40 changes: 12 additions & 28 deletions prototype/leaders/arthur.tscn
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
[gd_scene load_steps=24 format=2]
[gd_scene load_steps=20 format=2]

[ext_resource path="res://unit/unit.tscn" type="PackedScene" id=1]
[ext_resource path="res://map/tool/color_replace.tres" type="Shader" id=2]
[ext_resource path="res://assets/leaders/arthur_blue.png" type="Texture" id=3]
[ext_resource path="res://assets/leaders/arthur_red.png" type="Texture" id=4]

[sub_resource type="ShaderMaterial" id=30]
shader = ExtResource( 2 )
shader_param/origin = Color( 0.305882, 0.388235, 0.52549, 1 )
shader_param/origin2 = Color( 0.32549, 0.584314, 0.709804, 1 )
shader_param/origin3 = Color( 0.47451, 0.803922, 0.819608, 1 )
shader_param/origin4 = Color( 0.643137, 0.560784, 0.435294, 1 )
shader_param/new = Color( 0.537255, 0.317647, 0.4, 1 )
shader_param/new2 = Color( 0.843137, 0.396078, 0.396078, 1 )
shader_param/new3 = Color( 0.929412, 0.627451, 0.568627, 1 )
shader_param/new4 = Color( 0.521569, 0.462745, 0.376471, 1 )
shader_param/tolerance = 0.1

[sub_resource type="Animation" id=24]
resource_name = "attack"
length = 0.8
Expand Down Expand Up @@ -487,14 +474,6 @@ tracks/6/keys = {
atlas = ExtResource( 3 )
region = Rect2( 0, 0, 24, 24 )

[sub_resource type="AtlasTexture" id=34]
atlas = ExtResource( 3 )
region = Rect2( 24, 0, 24, 24 )

[sub_resource type="AtlasTexture" id=35]
atlas = ExtResource( 3 )
region = Rect2( 48, 0, 24, 24 )

[sub_resource type="AtlasTexture" id=38]
atlas = ExtResource( 4 )
region = Rect2( 0, 0, 24, 24 )
Expand All @@ -509,7 +488,7 @@ region = Rect2( 48, 0, 24, 24 )

[sub_resource type="SpriteFrames" id=36]
animations = [ {
"frames": [ SubResource( 37 ), SubResource( 34 ), SubResource( 35 ) ],
"frames": [ SubResource( 37 ) ],
"loop": true,
"name": "default",
"speed": 5.0
Expand Down Expand Up @@ -574,14 +553,22 @@ scale = Vector2( 10, 10 )
visible = false
scale = Vector2( 1.2, 1.2 )

[node name="icon" type="Sprite" parent="symbol" index="1"]
material = SubResource( 30 )
[node name="icon_blue" type="Sprite" parent="symbol" index="1"]
visible = false
scale = Vector2( 0.4, 0.4 )
texture = ExtResource( 3 )
offset = Vector2( 0, -2 )
region_enabled = true
region_rect = Rect2( 31, 0, 14, 14 )

[node name="icon_red" type="Sprite" parent="symbol" index="2"]
visible = false
scale = Vector2( 0.4, 0.4 )
texture = ExtResource( 4 )
offset = Vector2( 0, -2 )
region_enabled = true
region_rect = Rect2( 31, 0, 14, 14 )

[node name="state" parent="hud" index="0"]
margin_top = -38.0
margin_bottom = -22.0
Expand All @@ -597,10 +584,7 @@ anims/move = SubResource( 26 )
anims/stun = SubResource( 33 )

[node name="body" parent="sprites" index="1"]
visible = true
frames = SubResource( 36 )
animation = "default"
frame = 2
offset = Vector2( -2, -12 )

[node name="weapon" type="AnimatedSprite" parent="sprites" index="2"]
Expand Down
29 changes: 11 additions & 18 deletions prototype/leaders/bokuden.tscn
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
[gd_scene load_steps=24 format=2]
[gd_scene load_steps=22 format=2]

[ext_resource path="res://unit/unit.tscn" type="PackedScene" id=1]
[ext_resource path="res://map/tool/color_replace.tres" type="Shader" id=2]
[ext_resource path="res://assets/leaders/bokuden_red.png" type="Texture" id=3]
[ext_resource path="res://assets/leaders/bokuden_blue.png" type="Texture" id=4]

[sub_resource type="ShaderMaterial" id=40]
shader = ExtResource( 2 )
shader_param/origin = Color( 0.305882, 0.388235, 0.52549, 1 )
shader_param/origin2 = Color( 0.32549, 0.584314, 0.709804, 1 )
shader_param/origin3 = Color( 0.47451, 0.803922, 0.819608, 1 )
shader_param/origin4 = Color( 0.235294, 0.27451, 0.376471, 1 )
shader_param/new = Color( 0.537255, 0.317647, 0.4, 1 )
shader_param/new2 = Color( 0.756863, 0.360784, 0.360784, 1 )
shader_param/new3 = Color( 0.929412, 0.627451, 0.568627, 1 )
shader_param/new4 = Color( 0.796078, 0.286275, 0.360784, 1 )
shader_param/tolerance = 0.1

[sub_resource type="Animation" id=24]
resource_name = "attack"
length = 0.8
Expand Down Expand Up @@ -622,14 +609,22 @@ scale = Vector2( 10, 10 )
[node name="symbol_border" parent="symbol" index="0"]
visible = false

[node name="icon" type="Sprite" parent="symbol" index="1"]
material = SubResource( 40 )
[node name="icon_blue" type="Sprite" parent="symbol" index="1"]
visible = false
scale = Vector2( 0.4, 0.4 )
texture = ExtResource( 4 )
offset = Vector2( 0, -4 )
region_enabled = true
region_rect = Rect2( 7, 5, 30, 19 )

[node name="icon_red" type="Sprite" parent="symbol" index="2"]
visible = false
scale = Vector2( 0.4, 0.4 )
texture = ExtResource( 3 )
offset = Vector2( 0, -4 )
region_enabled = true
region_rect = Rect2( 7, 5, 30, 19 )

[node name="animations" type="AnimationPlayer" parent="." index="3"]
anims/attack = SubResource( 24 )
anims/death = SubResource( 31 )
Expand All @@ -638,9 +633,7 @@ anims/move = SubResource( 26 )
anims/stun = SubResource( 33 )

[node name="body" parent="sprites" index="1"]
visible = true
frames = SubResource( 44 )
animation = "default"
frame = 2
offset = Vector2( -3, -16 )

Expand Down
31 changes: 14 additions & 17 deletions prototype/leaders/hongi.tscn
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
[gd_scene load_steps=26 format=2]
[gd_scene load_steps=24 format=2]

[ext_resource path="res://unit/unit.tscn" type="PackedScene" id=1]
[ext_resource path="res://map/tool/color_replace.tres" type="Shader" id=2]
[ext_resource path="res://assets/leaders/hongi_blue.png" type="Texture" id=3]
[ext_resource path="res://assets/leaders/hongi_red.png" type="Texture" id=4]

[sub_resource type="ShaderMaterial" id=30]
shader = ExtResource( 2 )
shader_param/origin = Color( 0.305882, 0.388235, 0.52549, 1 )
shader_param/origin2 = Color( 0.32549, 0.584314, 0.709804, 1 )
shader_param/origin3 = Color( 0.47451, 0.803922, 0.819608, 1 )
shader_param/origin4 = Color( 0.380392, 0.305882, 0.270588, 1 )
shader_param/new = Color( 0.537255, 0.317647, 0.4, 1 )
shader_param/new2 = Color( 0.843137, 0.396078, 0.396078, 1 )
shader_param/new3 = Color( 0.835294, 0.556863, 0.501961, 1 )
shader_param/new4 = Color( 0.32549, 0.262745, 0.262745, 1 )
shader_param/tolerance = 0.1

[sub_resource type="Animation" id=24]
resource_name = "attack"
length = 0.8
Expand Down Expand Up @@ -593,14 +580,25 @@ projectile_rotation = 20.0
modulate = Color( 1, 1, 1, 1 )
scale = Vector2( 10, 10 )

[node name="icon" type="Sprite" parent="symbol" index="1"]
material = SubResource( 30 )
[node name="symbol_border" parent="symbol" index="0"]
visible = false

[node name="icon_blue" type="Sprite" parent="symbol" index="1"]
visible = false
scale = Vector2( 0.4, 0.4 )
texture = ExtResource( 3 )
offset = Vector2( -2, -2 )
region_enabled = true
region_rect = Rect2( 14, 4, 21, 18 )

[node name="icon_red" type="Sprite" parent="symbol" index="2"]
visible = false
scale = Vector2( 0.4, 0.4 )
texture = ExtResource( 4 )
offset = Vector2( -2, -2 )
region_enabled = true
region_rect = Rect2( 14, 4, 21, 18 )

[node name="state" parent="hud" index="0"]
margin_top = -39.0

Expand All @@ -618,7 +616,6 @@ anims/stun = SubResource( 33 )
position = Vector2( 0, 9 )

[node name="body" parent="sprites" index="1"]
visible = true
frames = SubResource( 36 )
animation = "red"
offset = Vector2( -6, -15 )
Expand Down
Loading

0 comments on commit d0ec459

Please sign in to comment.