Compare commits
22 Commits
9d917e95ab
...
v0.6.14
| Author | SHA1 | Date | |
|---|---|---|---|
| 2459d15fc0 | |||
| 3552a5e51d | |||
| 38b05eb4ef | |||
| 735ab3774d | |||
| 43aaa6e28f | |||
| 544f5c466e | |||
| 0b80d2cdf6 | |||
| b82fe0f3d7 | |||
| 860168e4eb | |||
| 84c29ed064 | |||
| 14e4450679 | |||
| 15a4a2e953 | |||
| 201284f3c2 | |||
| 708740d757 | |||
| f82ccbedd9 | |||
| 0db2fa0f96 | |||
| 41de04c2e2 | |||
| 5bb566351d | |||
| 88bcf77aa9 | |||
| 4de9027d1e | |||
| 044d193f8d | |||
| d9cae38a11 |
@@ -0,0 +1,62 @@
|
|||||||
|
name: Android
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
android:
|
||||||
|
runs-on: godot
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Godot version
|
||||||
|
run: godot --version
|
||||||
|
|
||||||
|
- name: Build APK
|
||||||
|
run: |
|
||||||
|
mkdir -p build
|
||||||
|
|
||||||
|
godot \
|
||||||
|
--headless \
|
||||||
|
--path . \
|
||||||
|
--export-release "Android" \
|
||||||
|
build/app.apk
|
||||||
|
|
||||||
|
- name: Verify APK
|
||||||
|
run: |
|
||||||
|
test -f build/app.apk
|
||||||
|
ls -lh build/app.apk
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
run: |
|
||||||
|
curl -f \
|
||||||
|
-X POST \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"https://gt.owad.ru/api/v1/repos/K/owniverse/releases" \
|
||||||
|
-d "{
|
||||||
|
\"tag_name\": \"${GITHUB_REF_NAME}\",
|
||||||
|
\"name\": \"${GITHUB_REF_NAME}\",
|
||||||
|
\"body\": \"Android build ${GITHUB_REF_NAME}\"
|
||||||
|
}"
|
||||||
|
|
||||||
|
- name: Upload APK to Release
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
run: |
|
||||||
|
RELEASE_ID=$(curl -fsS \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
"https://gt.owad.ru/api/v1/repos/K/owniverse/releases/tags/${GITHUB_REF_NAME}" \
|
||||||
|
| python3 -c 'import sys,json; print(json.load(sys.stdin)["id"])')
|
||||||
|
|
||||||
|
curl -f \
|
||||||
|
-X POST \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
-F "attachment=@build/app.apk" \
|
||||||
|
"https://gt.owad.ru/api/v1/repos/K/owniverse/releases/${RELEASE_ID}/assets?name=owniverse-${GITHUB_REF_NAME}.apk"
|
||||||
@@ -1 +1 @@
|
|||||||
uid://dojk16crca3cx
|
uid://dy0hrqie4ritn
|
||||||
|
|||||||
+5
-5
@@ -1,7 +1,5 @@
|
|||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
#signal produce_items(item_id: String, amount: int)
|
|
||||||
|
|
||||||
const OWNIVERSE_ITEM = preload("uid://d3xjfxwe3w16v")
|
const OWNIVERSE_ITEM = preload("uid://d3xjfxwe3w16v")
|
||||||
|
|
||||||
const SPEED_TEXTURE_NAME_TEMPLATE = "res://ui/topmenu/time&speed/time%s.png"
|
const SPEED_TEXTURE_NAME_TEMPLATE = "res://ui/topmenu/time&speed/time%s.png"
|
||||||
@@ -98,9 +96,6 @@ func set_owniverse_item_value() -> void:
|
|||||||
owniverse.items_to_update = {}
|
owniverse.items_to_update = {}
|
||||||
|
|
||||||
|
|
||||||
#func unlock_owniverse_item() -> void:
|
|
||||||
#pass
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
func _on_indicator_pressed(indicator_name: String, page: int = 0):
|
func _on_indicator_pressed(indicator_name: String, page: int = 0):
|
||||||
@@ -300,6 +295,11 @@ func _change_speed(delta: int) -> void:
|
|||||||
|
|
||||||
func _on_topmenu_button_pressed(ButtonName) -> void:
|
func _on_topmenu_button_pressed(ButtonName) -> void:
|
||||||
print(ButtonName)
|
print(ButtonName)
|
||||||
|
#var s: float = 1E15
|
||||||
|
#var z = 1.0
|
||||||
|
#for i in range(30):
|
||||||
|
#print(i, " | ", z, " | ", " | ", s - z)
|
||||||
|
#z *= 10
|
||||||
|
|
||||||
|
|
||||||
func _on_save_data() -> void:
|
func _on_save_data() -> void:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[gd_scene format=3 uid="uid://d3xjfxwe3w16v"]
|
[gd_scene format=3 uid="uid://d3xjfxwe3w16v"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bxxllddlgurus" path="res://ui/owniverse_item/owniverse_item.gd" id="1_e6ro1"]
|
[ext_resource type="Script" uid="uid://bxxllddlgurus" path="res://ui/owniverse_item/owniverse_item.gd" id="1_d5xam"]
|
||||||
[ext_resource type="Texture2D" uid="uid://56w57w6iu3np" path="res://ui/owniverse_item/selected.png" id="2_eurq3"]
|
[ext_resource type="Texture2D" uid="uid://56w57w6iu3np" path="res://ui/owniverse_item/selected.png" id="2_pbv1j"]
|
||||||
|
|
||||||
[node name="Button" type="Control" unique_id=667620208]
|
[node name="Button" type="Control" unique_id=667620208]
|
||||||
visible = false
|
visible = false
|
||||||
@@ -10,7 +10,7 @@ anchors_preset = 0
|
|||||||
offset_right = 216.0
|
offset_right = 216.0
|
||||||
offset_bottom = 260.0
|
offset_bottom = 260.0
|
||||||
mouse_filter = 1
|
mouse_filter = 1
|
||||||
script = ExtResource("1_e6ro1")
|
script = ExtResource("1_d5xam")
|
||||||
|
|
||||||
[node name="Selection" type="TextureRect" parent="." unique_id=674793134]
|
[node name="Selection" type="TextureRect" parent="." unique_id=674793134]
|
||||||
visible = false
|
visible = false
|
||||||
@@ -18,7 +18,7 @@ layout_mode = 0
|
|||||||
offset_right = 216.0
|
offset_right = 216.0
|
||||||
offset_bottom = 216.0
|
offset_bottom = 216.0
|
||||||
mouse_filter = 2
|
mouse_filter = 2
|
||||||
texture = ExtResource("2_eurq3")
|
texture = ExtResource("2_pbv1j")
|
||||||
|
|
||||||
[node name="TextureButton" type="TextureButton" parent="." unique_id=1377839155]
|
[node name="TextureButton" type="TextureButton" parent="." unique_id=1377839155]
|
||||||
custom_minimum_size = Vector2(216, 216)
|
custom_minimum_size = Vector2(216, 216)
|
||||||
|
|||||||
@@ -21,14 +21,14 @@ LRG|0||||50||50000000||||S:300||DSN^SGRB%0.1|2|||RG|Star|||||
|
|||||||
HRG|0||||100||10000000||||S:400.||SN^GRB%1|2|||RG|Star|||||
|
HRG|0||||100||10000000||||S:400.||SN^GRB%1|2|||RG|Star|||||
|
||||||
RSG|0||||300||1000000||||S:500||BSN^LGRB%3|2|||RG|Star|||||
|
RSG|0||||300||1000000||||S:500||BSN^LGRB%3|2|||RG|Star|||||
|
||||||
RHG|0||||1000||100000||||S:600||HN^HGRB%10|2|||RG|Star|||||
|
RHG|0||||1000||100000||||S:600||HN^HGRB%10|2|||RG|Star|||||
|
||||||
DSN|0||||||0|||2|S:59.1||SNS:1&H:6.5&He:13.5&Met:11&blast:2|2|mass:15&H:6.5&HE:13.5&MET:11||||SNGRBB||||
|
DSN|0||||||1|||2|S:59.1||SNS:1&H:6.5&He:13.5&Met:11&blast:2|2|mass:15&H:6.5&HE:13.5&MET:11||||SNGRBB||||
|
||||||
SN|0||||||0|||9|S:99.1||LNS:1&H:8&He:50&Met:11&blast:9|2|mass:18&H:8&HE:50&MET:11||||SNGRBB||||
|
SN|0||||||1|||9|S:99.1||LNS:1&H:8&He:50&Met:11&blast:9|2|mass:18&H:8&HE:50&MET:11||||SNGRBB||||
|
||||||
BSN|0||||||0||.|305|S:309.1||MGT:1&H:15&He:186&Met:15&blast:305|2|mass:21&H:15&HE:186&MET:15||||SNGRBB||||
|
BSN|0||||||1||.|305|S:309.1||MGT:1&H:15&He:186&Met:15&blast:305|2|mass:21&H:15&HE:186&MET:15||||SNGRBB||||
|
||||||
HN|0||||||0|||9990|S:939.1||BH40:1&H:30&He:560&Met:30&blast:9990|2|mass:40&H:30&HE:560&MET:30||||SNGRBB||||
|
HN|0||||||1|||9990|S:939.1||BH40:1&H:30&He:560&Met:30&blast:9990|2|mass:40&H:30&HE:560&MET:30||||SNGRBB||||
|
||||||
SGRB|0||||||0||0.001|31|S:149.1||BH25:1&H:0.5&He:10&Met:4&blast:31|2|mass:25&H:0.5&HE:10&MET:4||||SNGRBB||||
|
SGRB|0||||||1||0.001|31|S:149.1||BH25:1&H:0.5&He:10&Met:4&blast:31|2|mass:25&H:0.5&HE:10&MET:4||||SNGRBB||||
|
||||||
GRB|0||||||0||0.01|136|S:239.1||BH30:1&H:19&He:12&Met:5&blast:136|2|mass:30&H:19&HE:12&MET:5||||SNGRBB||||
|
GRB|0||||||1||0.01|136|S:239.1||BH30:1&H:19&He:12&Met:5&blast:136|2|mass:30&H:19&HE:12&MET:5||||SNGRBB||||
|
||||||
LGRB|0||||||0||0.03|3446|S:669.1||BH40:1&H:68&He:18&Met:9&blast:3446|2|mass:40&H:68&HE:18&MET:9||||SNGRBB||||
|
LGRB|0||||||1||0.03|3446|S:669.1||BH40:1&H:68&He:18&Met:9&blast:3446|2|mass:40&H:68&HE:18&MET:9||||SNGRBB||||
|
||||||
HGRB|0||||||0||0.1|97342|S:1939.1||BH60:1&H:0&He:40&Met:10&blast:97342|2|mass:60&H:0&HE:40&MET:10||||SNGRBB||||
|
HGRB|0||||||1||0.1|97342|S:1939.1||BH60:1&H:0&He:40&Met:10&blast:97342|2|mass:60&H:0&HE:40&MET:10||||SNGRBB||||
|
||||||
CBD|0||||0.1||||||||||||BD||||||
|
CBD|0||||0.1||||||||||||BD||||||
|
||||||
WD|1|WD:1|||||||||||||||||||||
|
WD|1|WD:1|||||||||||||||||||||
|
||||||
TWD|0||||0.8||||||||||||WD|Star|Degen||||
|
TWD|0||||0.8||||||||||||WD|Star|Degen||||
|
||||||
|
|||||||
+6
-6
@@ -74,7 +74,7 @@ Remove-Item -Recurse -Force '{temp_dir}'"
|
|||||||
|
|
||||||
name="Android"
|
name="Android"
|
||||||
platform="Android"
|
platform="Android"
|
||||||
runnable=true
|
runnable=false
|
||||||
dedicated_server=false
|
dedicated_server=false
|
||||||
custom_features=""
|
custom_features=""
|
||||||
export_filter="all_resources"
|
export_filter="all_resources"
|
||||||
@@ -98,11 +98,11 @@ script_export_mode=2
|
|||||||
|
|
||||||
custom_template/debug=""
|
custom_template/debug=""
|
||||||
custom_template/release=""
|
custom_template/release=""
|
||||||
gradle_build/use_gradle_build=true
|
gradle_build/use_gradle_build=false
|
||||||
gradle_build/gradle_build_directory=""
|
gradle_build/gradle_build_directory=""
|
||||||
gradle_build/android_source_template=""
|
gradle_build/android_source_template=""
|
||||||
gradle_build/compress_native_libraries=true
|
gradle_build/compress_native_libraries=false
|
||||||
gradle_build/export_format=1
|
gradle_build/export_format=0
|
||||||
gradle_build/min_sdk=""
|
gradle_build/min_sdk=""
|
||||||
gradle_build/target_sdk=""
|
gradle_build/target_sdk=""
|
||||||
gradle_build/custom_theme_attributes={}
|
gradle_build/custom_theme_attributes={}
|
||||||
@@ -110,11 +110,11 @@ architectures/armeabi-v7a=false
|
|||||||
architectures/arm64-v8a=true
|
architectures/arm64-v8a=true
|
||||||
architectures/x86=false
|
architectures/x86=false
|
||||||
architectures/x86_64=false
|
architectures/x86_64=false
|
||||||
version/code=129
|
version/code=130
|
||||||
version/name=""
|
version/name=""
|
||||||
package/unique_name="com.KIDGameProduction.Owniverse"
|
package/unique_name="com.KIDGameProduction.Owniverse"
|
||||||
package/name="Owniverse"
|
package/name="Owniverse"
|
||||||
package/signed=true
|
package/signed=false
|
||||||
package/app_category=2
|
package/app_category=2
|
||||||
package/retain_data_on_uninstall=false
|
package/retain_data_on_uninstall=false
|
||||||
package/exclude_from_recents=false
|
package/exclude_from_recents=false
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ compatibility/default_parent_skeleton_in_mesh_instance_3d=true
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Owniverse"
|
config/name="Owniverse"
|
||||||
config/version="0.6.13"
|
config/version="0.6.14"
|
||||||
run/main_scene="uid://bv384dpmvjv8o"
|
run/main_scene="uid://bv384dpmvjv8o"
|
||||||
config/features=PackedStringArray("4.7", "Mobile")
|
config/features=PackedStringArray("4.7", "Mobile")
|
||||||
boot_splash/show_image=false
|
boot_splash/show_image=false
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ var evolution: OwniverseEvolution = OwniverseEvolution.new()
|
|||||||
|
|
||||||
signal unlock_item(item_id: String)
|
signal unlock_item(item_id: String)
|
||||||
|
|
||||||
var current_year: float = 0
|
var current_year: float = 0.0
|
||||||
var current_speed: int = 1
|
var current_speed: int = 1
|
||||||
var current_speed_in_years: float = 1
|
var current_speed_in_years: float = 1.0
|
||||||
|
|
||||||
var entities: Dictionary[String, OwniverseEntity] = {}
|
var entities: Dictionary[String, OwniverseEntity] = {}
|
||||||
var entity_groups: Dictionary[String, Array] = {}
|
var entity_groups: Dictionary[String, Array] = {}
|
||||||
@@ -21,24 +21,15 @@ var locked_entities: Array = []
|
|||||||
var cumulative_amount: Dictionary[String, float] = {}
|
var cumulative_amount: Dictionary[String, float] = {}
|
||||||
var current_amount: Dictionary[String, float] = {}
|
var current_amount: Dictionary[String, float] = {}
|
||||||
|
|
||||||
#var batch_count: int = 40
|
|
||||||
#var entity_batches = {}
|
|
||||||
|
|
||||||
|
|
||||||
func cycle(year_delta: float) -> void:
|
func cycle(year_delta: float) -> void:
|
||||||
# all owniverse activity should be called here
|
# all owniverse activity should be called here
|
||||||
_auto_production(year_delta)
|
_auto_production(year_delta)
|
||||||
#_entity_evolution(year_delta)
|
|
||||||
|
|
||||||
_check_locked_items()
|
_check_locked_items()
|
||||||
|
|
||||||
#var v = _get_distribution(current_amount)
|
|
||||||
evolution.update_distribution(current_amount)
|
evolution.update_distribution(current_amount)
|
||||||
|
|
||||||
#for k in current_amount:
|
|
||||||
#if current_amount[k] != 0:
|
|
||||||
#print(k, "|", current_amount[k])
|
|
||||||
|
|
||||||
|
|
||||||
#region auto production and evolution
|
#region auto production and evolution
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ var gamma: float
|
|||||||
var blast: int
|
var blast: int
|
||||||
var life_product: Dictionary = {}
|
var life_product: Dictionary = {}
|
||||||
var product_per_year_type: String = ""
|
var product_per_year_type: String = ""
|
||||||
var product_per_year_amount: float = 0.0
|
var product_per_year_amount: float = 0
|
||||||
var voids: int
|
var voids: int
|
||||||
var output_or: Dictionary = {}
|
var output_or: Dictionary = {}
|
||||||
var output_and: Dictionary = {}
|
var output_and: Dictionary = {}
|
||||||
@@ -41,14 +41,16 @@ func _init(values: Dictionary) -> void:
|
|||||||
mass = float(values.mass)
|
mass = float(values.mass)
|
||||||
space = int(values.space)
|
space = int(values.space)
|
||||||
lifespan = float(values.lifespan)
|
lifespan = float(values.lifespan)
|
||||||
lifespan_delta = lifespan / Global.batch_count / 2 # need for proper math
|
lifespan_delta = lifespan / Global.batch_count / 2 if lifespan > 10 else lifespan
|
||||||
auto = float(values.auto)
|
auto = float(values.auto)
|
||||||
gamma = float(values.gamma)
|
gamma = float(values.gamma)
|
||||||
blast = int(values.blast)
|
blast = int(values.blast)
|
||||||
|
|
||||||
life_product = _parse_and_string(values.life_product)
|
life_product = _parse_and_string(values.life_product)
|
||||||
for key in life_product.keys():
|
for key in life_product.keys():
|
||||||
product_per_year_type = key
|
product_per_year_type = key
|
||||||
product_per_year_amount = life_product[key] / lifespan if lifespan != 0 else 0
|
product_per_year_amount = life_product[key] / lifespan if lifespan != 0 else 0
|
||||||
|
#print(id, " | ", lifespan_delta, " | ", lifespan)
|
||||||
|
|
||||||
voids = int(values.voids)
|
voids = int(values.voids)
|
||||||
output_or = _parse_or_string(values.output)
|
output_or = _parse_or_string(values.output)
|
||||||
|
|||||||
@@ -2,17 +2,37 @@ extends Node
|
|||||||
|
|
||||||
class_name OwniverseEvolution
|
class_name OwniverseEvolution
|
||||||
|
|
||||||
|
const FLOAT_THRESHOLD: float = 1.0E14
|
||||||
|
# TODO to save !!!
|
||||||
|
var state: Dictionary = {
|
||||||
|
'year': 0.0,
|
||||||
|
'energy': 1E14,
|
||||||
|
}
|
||||||
|
|
||||||
var entities: Dictionary[String, OwniverseEntity] = {}
|
var entities: Dictionary[String, OwniverseEntity] = {}
|
||||||
|
|
||||||
var producing_entities: Array[OwniverseEntity] = []
|
var producing_entities: Array[OwniverseEntity] = []
|
||||||
|
|
||||||
|
# TODO to save !!!
|
||||||
|
var auto_production_rest: Dictionary = {
|
||||||
|
'H': 0.0,
|
||||||
|
'S': 0.0,
|
||||||
|
'auto': 0.0,
|
||||||
|
}
|
||||||
|
|
||||||
var evolving_entities: Array[OwniverseEntity] = []
|
var evolving_entities: Array[OwniverseEntity] = []
|
||||||
|
|
||||||
|
# TODO to save !!!
|
||||||
var batches: Dictionary[String, Array] = {}
|
var batches: Dictionary[String, Array] = {}
|
||||||
|
# TODO to save !!!
|
||||||
|
var amount: Dictionary[String, float] = {}
|
||||||
|
|
||||||
|
|
||||||
var distribution: Dictionary[String, float] = {}
|
var distribution: Dictionary[String, float] = {}
|
||||||
|
|
||||||
|
|
||||||
func add(entity: OwniverseEntity, year: float, amount: float):
|
func add(entity: OwniverseEntity, year: float, amount: float):
|
||||||
var _batch_array:Array = batches[entity.id]
|
var _batch_array: Array = batches[entity.id]
|
||||||
var _from_year: float = year + entity.lifespan - entity.lifespan_delta
|
var _from_year: float = year + entity.lifespan - entity.lifespan_delta
|
||||||
var _to_year: float = year + entity.lifespan + entity.lifespan_delta
|
var _to_year: float = year + entity.lifespan + entity.lifespan_delta
|
||||||
if _batch_array.size() != 0 and _batch_array[-1].to_year > year + entity.lifespan:
|
if _batch_array.size() != 0 and _batch_array[-1].to_year > year + entity.lifespan:
|
||||||
@@ -25,17 +45,20 @@ func add(entity: OwniverseEntity, year: float, amount: float):
|
|||||||
}
|
}
|
||||||
_batch_array.append(_batch)
|
_batch_array.append(_batch)
|
||||||
|
|
||||||
|
print('---------')
|
||||||
|
print(batches)
|
||||||
|
|
||||||
|
|
||||||
func process(from_year: float, to_year: float) -> void:
|
func process(from_year: float, to_year: float) -> void:
|
||||||
# производим
|
# производим
|
||||||
# эволюционируем
|
# эволюционируем
|
||||||
# записываем новые
|
# записываем новые
|
||||||
var _to_produce:= {}
|
var _to_produce := {}
|
||||||
var _to_evolute:= {}
|
var _to_evolute := {}
|
||||||
for _entity_id in batches:
|
for _entity_id in batches:
|
||||||
_to_produce[_entity_id] = 0
|
_to_produce[_entity_id] = 0
|
||||||
_to_evolute[_entity_id] = 0
|
_to_evolute[_entity_id] = 0
|
||||||
var _new_batch_array:= []
|
var _new_batch_array := []
|
||||||
for _batch: Dictionary in batches[_entity_id]:
|
for _batch: Dictionary in batches[_entity_id]:
|
||||||
# production
|
# production
|
||||||
_to_produce[_entity_id] += _batch.amount
|
_to_produce[_entity_id] += _batch.amount
|
||||||
@@ -63,18 +86,45 @@ func process(from_year: float, to_year: float) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func produce(from_year: float, to_year: float):
|
func produce(from_year: float, to_year: float):
|
||||||
for batch_name in batches:
|
var _time_delta = to_year - from_year
|
||||||
pass
|
# get entity array for production
|
||||||
|
for _entity: OwniverseEntity in producing_entities:
|
||||||
|
var _to_produce: float = 0.0
|
||||||
|
for _batch: Dictionary in batches[_entity.id]:
|
||||||
|
_to_produce += _batch.amount
|
||||||
|
_to_produce *= _time_delta * _entity.product_per_year_amount
|
||||||
|
if _entity.auto > 0:
|
||||||
|
var _auto_production_part: float = _entity.auto * _to_produce
|
||||||
|
_to_produce -= _auto_production_part
|
||||||
|
auto_production_rest.auto += _auto_production_part
|
||||||
|
|
||||||
|
auto_production_rest[_entity.product_per_year_type] += _to_produce
|
||||||
|
print("auto prod rest: ", auto_production_rest)
|
||||||
|
auto_production_rest["H"] = produce_hs("H", auto_production_rest["H"])
|
||||||
|
auto_production_rest["S"] = produce_hs("S", auto_production_rest["S"])
|
||||||
|
|
||||||
|
|
||||||
|
func produce_hs(entity_id: String, value: float) -> float:
|
||||||
|
var _to_produce: float = floorf(value)
|
||||||
|
amount[entity_id] += _to_produce
|
||||||
|
# TODO double double math
|
||||||
|
if _to_produce > state["energy"]:
|
||||||
|
_to_produce = state["energy"]
|
||||||
|
state["energy"] -= _to_produce
|
||||||
|
return value - _to_produce
|
||||||
|
|
||||||
|
func produce_auto() -> float:
|
||||||
|
return 0.0
|
||||||
|
|
||||||
func init_entity(entity: OwniverseEntity) -> void:
|
func init_entity(entity: OwniverseEntity) -> void:
|
||||||
entities[entity.id] = entity
|
entities[entity.id] = entity
|
||||||
|
amount[entity.id] = 0.0
|
||||||
if entity.product_per_year_type != "":
|
if entity.product_per_year_type != "":
|
||||||
producing_entities.append(entity)
|
producing_entities.append(entity)
|
||||||
|
|
||||||
if entity.lifespan > 0:
|
if entity.lifespan > 0:
|
||||||
evolving_entities.append(entity)
|
evolving_entities.append(entity)
|
||||||
|
|
||||||
batches[entity.id] = []
|
batches[entity.id] = []
|
||||||
|
|
||||||
|
|
||||||
@@ -91,3 +141,9 @@ func update_distribution(_distribute_by: Dictionary[String, float]) -> void:
|
|||||||
|
|
||||||
for id in distribution:
|
for id in distribution:
|
||||||
distribution[id] /= _total
|
distribution[id] /= _total
|
||||||
|
|
||||||
|
#func _add_float(a: float, b: Array[float]) -> Array[float]:
|
||||||
|
#if a < FLOAT_THRESHOLD:
|
||||||
|
#return [a+b[0], 0]
|
||||||
|
#else:
|
||||||
|
#return [a+b[0], 0]
|
||||||
|
|||||||
Reference in New Issue
Block a user