Added base items on buy/sell, new valuables icons
15
menus/Base Menu/BuySell/menu_buy.tres
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
[gd_resource type="Resource" script_class="Menu" load_steps=4 format=3 uid="uid://cbvax7aprnrig"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/Classes/Menu/combo_menu_resource.gd" id="1_xamua"]
|
||||
[ext_resource type="Script" path="res://scripts/Classes/Menu/menu.gd" id="2_f8fna"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_5pmle"]
|
||||
script = ExtResource("1_xamua")
|
||||
item_script = &"res://scripts/Base/Menu/send_message.gd"
|
||||
item_menu = &"res://menus/Base Menu/root_menu.tres"
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_f8fna")
|
||||
item_ids = Array[String](["BASE_FETCH_BUY_CANCEL", "NULL", "NULL", "NULL", "NULL", "NULL", "NULL", "NULL"])
|
||||
item_actions = Array[int]([3, 0, 0, 0, 0, 0, 0, 0])
|
||||
item_data = Array[Resource("res://scripts/Classes/Menu/menu_resource.gd")]([SubResource("Resource_5pmle"), null, null, null, null, null, null, null])
|
||||
15
menus/Base Menu/BuySell/menu_sell.tres
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
[gd_resource type="Resource" script_class="Menu" load_steps=4 format=3 uid="uid://cgxrk15hgidts"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/Classes/Menu/combo_menu_resource.gd" id="1_u5y0w"]
|
||||
[ext_resource type="Script" path="res://scripts/Classes/Menu/menu.gd" id="2_0edl4"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_5pmle"]
|
||||
script = ExtResource("1_u5y0w")
|
||||
item_script = &"res://scripts/Base/Menu/send_message.gd"
|
||||
item_menu = &"res://menus/Base Menu/root_menu.tres"
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_0edl4")
|
||||
item_ids = Array[String](["BASE_FETCH_SELL_CANCEL", "NULL", "NULL", "NULL", "NULL", "NULL", "NULL", "NULL"])
|
||||
item_actions = Array[int]([3, 0, 0, 0, 0, 0, 0, 0])
|
||||
item_data = Array[Resource("res://scripts/Classes/Menu/menu_resource.gd")]([SubResource("Resource_5pmle"), null, null, null, null, null, null, null])
|
||||
20
menus/Base Menu/root_menu.tres
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
[gd_resource type="Resource" script_class="Menu" load_steps=5 format=3 uid="uid://2ohcxoor22hr"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/Classes/Menu/combo_menu_resource.gd" id="1_d2x8v"]
|
||||
[ext_resource type="Script" path="res://scripts/Classes/Menu/menu.gd" id="1_h4chp"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_iiy7m"]
|
||||
script = ExtResource("1_d2x8v")
|
||||
item_script = &"res://scripts/Base/Menu/send_message.gd"
|
||||
item_menu = &"res://menus/Base Menu/BuySell/menu_buy.tres"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_pbhiw"]
|
||||
script = ExtResource("1_d2x8v")
|
||||
item_script = &"res://scripts/Base/Menu/send_message.gd"
|
||||
item_menu = &"res://menus/Base Menu/BuySell/menu_sell.tres"
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_h4chp")
|
||||
item_ids = Array[String](["BASE_FETCH_BUY", "BASE_FETCH_SELL", "NULL", "NULL", "NULL", "NULL", "NULL", "NULL"])
|
||||
item_actions = Array[int]([3, 3, 0, 0, 0, 0, 0, 0])
|
||||
item_data = Array[Resource("res://scripts/Classes/Menu/menu_resource.gd")]([SubResource("Resource_iiy7m"), SubResource("Resource_pbhiw"), null, null, null, null, null, null])
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
[ext_resource type="Script" path="res://scripts/Base/actions_menu.gd" id="4_3gtyd"]
|
||||
[ext_resource type="Script" path="res://scripts/Base/close_button.gd" id="4_68ool"]
|
||||
[ext_resource type="Script" path="res://scripts/Base/Menu/dialogue.gd" id="4_swpa1"]
|
||||
[ext_resource type="Resource" uid="uid://c4jg3vwtxskjm" path="res://menus/Base Menu/test_menu_1.tres" id="5_rkret"]
|
||||
[ext_resource type="Resource" uid="uid://2ohcxoor22hr" path="res://menus/Base Menu/root_menu.tres" id="6_78in3"]
|
||||
|
||||
[node name="BaseMenu" type="Control"]
|
||||
layout_mode = 3
|
||||
|
|
@ -119,7 +119,7 @@ grow_horizontal = 2
|
|||
grow_vertical = 2
|
||||
columns = 2
|
||||
script = ExtResource("4_3gtyd")
|
||||
menu = ExtResource("5_rkret")
|
||||
menu = ExtResource("6_78in3")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="Action1" type="Button" parent="MenuBackground/Actions/ActionsMenu"]
|
||||
|
|
|
|||
|
|
@ -17,9 +17,19 @@ signal dock_requested
|
|||
|
||||
## Menu which will instantiate on docking
|
||||
@export var menu: PackedScene
|
||||
|
||||
## Faction that this base represents
|
||||
@export var faction: Game.Faction
|
||||
|
||||
## List of items that this base sells
|
||||
@export var items_on_sell: Array[Item]
|
||||
## List of items that this base buys
|
||||
@export var items_on_buy: Array[Item]
|
||||
|
||||
## List of prices for items that this base sells
|
||||
var sell_prices: Array[float]
|
||||
## List of prices for items that this base buys
|
||||
var buy_prices: Array[float]
|
||||
|
||||
## Decides whether ship is docked or in process
|
||||
var dock_state: DockState = DockState.Ready
|
||||
|
||||
|
|
@ -37,6 +47,7 @@ func _ready():
|
|||
dock_area.body_exited.connect(dock_area_body_exited)
|
||||
dock_requested.connect(on_dock_requested)
|
||||
dock_ready()
|
||||
generate_prices()
|
||||
|
||||
## Switches dock state
|
||||
func on_dock_requested():
|
||||
|
|
@ -90,20 +101,38 @@ func dock_busy():
|
|||
var menu_instance = menu.instantiate()
|
||||
menu_instance.base = self
|
||||
player_ship.non_colorable_gui.add_child(menu_instance)
|
||||
|
||||
## Sets dock state to Leave
|
||||
func dock_leave():
|
||||
dock_state = DockState.Leave
|
||||
disable_gate()
|
||||
|
||||
## Shows gate
|
||||
func enable_gate():
|
||||
gate_static.visible = true
|
||||
gate_static.process_mode = Node.PROCESS_MODE_INHERIT
|
||||
gate_area.visible = false
|
||||
dock_area.visible = false
|
||||
|
||||
## Hides gate so base is accessible to enter/exit
|
||||
func disable_gate():
|
||||
gate_static.visible = false
|
||||
gate_static.process_mode = Node.PROCESS_MODE_DISABLED
|
||||
gate_area.visible = true
|
||||
dock_area.visible = true
|
||||
|
||||
## Generates prices for valuable items
|
||||
func generate_prices():
|
||||
# gen prices for buyable items
|
||||
for i in range(len(items_on_buy)):
|
||||
var item = items_on_buy[i]
|
||||
if item in items_on_sell:
|
||||
# buy not higher than avg price
|
||||
buy_prices[i] = randi_range(item.min_price * 100, (item.max_price + item.min_price) * 50) / 100.0
|
||||
else:
|
||||
buy_prices[i] = randi_range(item.min_price * 100, item.max_price * 100) / 100.0
|
||||
# gen prices for items in sell
|
||||
for i in range(len(items_on_sell)):
|
||||
var item = items_on_sell[i]
|
||||
if item in items_on_buy:
|
||||
# sell not lower than avg price
|
||||
sell_prices[i] = randi_range((item.min_price + item.max_price) * 50, item.max_price * 100) / 100.0
|
||||
else:
|
||||
sell_prices[i] = randi_range(item.min_price * 100, item.max_price * 100) / 100.0
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ class_name Game
|
|||
|
||||
## TODO: rewrite item system
|
||||
|
||||
enum ItemType {Valuable, Weapon, Hull, Shield, Engine, Ammunition}
|
||||
|
||||
enum AmmoType {None, LaserEnergy, Rockets}
|
||||
enum BaseType {Power, Mining, Food, Trading, Module}
|
||||
enum Faction {None, Player, Peaceful, Neutral, Aggressive}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,12 @@ extends Resource
|
|||
|
||||
class_name Item
|
||||
|
||||
enum ItemType {Valuable, Weapon, Hull, Shield, Engine, Ammunition}
|
||||
|
||||
@export var name : String
|
||||
@export var description : String
|
||||
@export var min_price : float
|
||||
@export var max_price : float
|
||||
@export var weight : float
|
||||
@export var icon : Texture
|
||||
@export var type : Game.ITEM_TYPE
|
||||
@export var type : ItemType
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 254 B |
BIN
sprites/items_icons/energy_cell.png
Normal file
|
After Width: | Height: | Size: 796 B |
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cova10yh1rlk1"
|
||||
path="res://.godot/imported/water.png-c8b3df05b2aab92358df5a49fb5a60ba.ctex"
|
||||
uid="uid://buh2eg0sjlcx0"
|
||||
path="res://.godot/imported/energy_cell.png-9715829585386ce4220f2bb1d67cdd9c.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/items_icons/water.png"
|
||||
dest_files=["res://.godot/imported/water.png-c8b3df05b2aab92358df5a49fb5a60ba.ctex"]
|
||||
source_file="res://sprites/items_icons/energy_cell.png"
|
||||
dest_files=["res://.godot/imported/energy_cell.png-9715829585386ce4220f2bb1d67cdd9c.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
Before Width: | Height: | Size: 260 B |
BIN
sprites/items_icons/food_supplies.png
Normal file
|
After Width: | Height: | Size: 1 KiB |
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://w3aft10s2hxd"
|
||||
path="res://.godot/imported/food.png-d786f9d11f7b590dd57cbb0e0eba166e.ctex"
|
||||
uid="uid://bvun3kxlvs712"
|
||||
path="res://.godot/imported/food_supplies.png-ae0622133a25efc1a080a47bd9df0359.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/items_icons/food.png"
|
||||
dest_files=["res://.godot/imported/food.png-d786f9d11f7b590dd57cbb0e0eba166e.ctex"]
|
||||
source_file="res://sprites/items_icons/food_supplies.png"
|
||||
dest_files=["res://.godot/imported/food_supplies.png-ae0622133a25efc1a080a47bd9df0359.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 1.4 KiB |
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dlh6eyywjrsk4"
|
||||
uid="uid://fttis3gwgq02"
|
||||
path="res://.godot/imported/raw_materials.png-17c645253a86197988c3802ae3935bdc.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 243 B |
BIN
sprites/items_icons/water_barrel.png
Normal file
|
After Width: | Height: | Size: 901 B |
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://daojdy0tpvsoh"
|
||||
path="res://.godot/imported/energy.png-56852b83575bd48e69877e4e7f810483.ctex"
|
||||
uid="uid://cvimydsdecmom"
|
||||
path="res://.godot/imported/water_barrel.png-fab99a878661fcb2fc07982bd58602b7.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/items_icons/energy.png"
|
||||
dest_files=["res://.godot/imported/energy.png-56852b83575bd48e69877e4e7f810483.ctex"]
|
||||
source_file="res://sprites/items_icons/water_barrel.png"
|
||||
dest_files=["res://.godot/imported/water_barrel.png-fab99a878661fcb2fc07982bd58602b7.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
@ -1,4 +1,14 @@
|
|||
,en,ru
|
||||
DIALOGUE_ENTRY_POINT,Entering chat with {race}...\nLogged in as {profile_name}.\n> ,Осуществление связи с {race}...\nВы вошли в систему как {profile_name}\n>
|
||||
BASE_TEST_MESSAGE_LOCAL,Greet,Поприветствовать
|
||||
BASE_TEST_MESSAGE_RECEIVED,"Hello, gryadki!\n\tBye, ponos!\n> ","Хеллоу, грядки!\n\tБай, понос!\n> "
|
||||
BASE_TEST_MESSAGE_RECEIVED,"Hello, gryadki!\nBye, ponos!\n> ","Хеллоу, грядки!\nБай, понос!\n> "
|
||||
BASE_FETCH_BUY_LOCAL,"Ask, what they sell","Спросить, что они покупают"
|
||||
BASE_FETCH_BUY_RECEIVED,I would like to buy something\nWe are selling:\n[ol]{sell_list}[/ol]\n> ,Я бы хотел что-нибудь купить\nМы продаём:\n[ol]{sell_list}[/ol]\n>
|
||||
BASE_FETCH_SELL_LOCAL,"Ask, what they buy","Спросить, что они продают"
|
||||
BASE_FETCH_SELL_RECEIVED,I have some items to sell\nWe can buy:\n[ol]{buy_list}[/ol]\n> ,У меня есть кое-что на продажу\nМы готовы купить:\n[ol]{buy_list}[/ol]\n>
|
||||
BASE_FETCH_PRICE_ITEM,[li][img=26x26]{item_img}[/img]\t{item_name} — {item_price}[/li],[li][img=26x26]{item_img}[/img]\t{item_name} — {item_price}[/li]
|
||||
BASE_FETCH_BUY_CANCEL_LOCAL,Buy nothing,Ничего не покупать
|
||||
BASE_FETCH_BUY_CANCEL_RECEIVED,I changed my mind\nErm...Fine...\nAnything else?\n> ,Я передумал\nЧто ж...Ладно...\nЧто-то ещё?\n>
|
||||
BASE_FETCH_SELL_CANCEL_LOCAL,Sell nothing,Ничего не продавать
|
||||
BASE_FETCH_SELL_CANCEL_RECEIVED,I changed my mind\nErm...Fine...\nAnything else?\n> ,Я передумал\nЧто ж...Ладно...\nЧто-то ещё?\n>
|
||||
NULL, ,
|
||||
|