Skip to content

Commit

Permalink
Merge pull request #26 from EamonnMR/biome-backgrounds
Browse files Browse the repository at this point in the history
Biome backgrounds
  • Loading branch information
EamonnMR authored Jul 22, 2023
2 parents aecb426 + abd1e89 commit b26d899
Show file tree
Hide file tree
Showing 127 changed files with 10,359 additions and 216 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.godot/editor/*
.godot/*
data/.~lock.*
export/*
87 changes: 46 additions & 41 deletions Cheats.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,45 @@ extends Node

var explore_all = false
var max_craft_level = false
var longjump_enabled = false
var jump_anywhere = false

var CHEATS = [
{
"hash": "d10ba5f768ac9db04b8419a2590bce54",
"callback": func explore_all_now(args):
explore_all = true
for i in Procgen.systems:
Client.get_ui().get_node("Map").update_for_explore(i)
return true},
{
"hash": "eba4a7a2f23a106e01e1380deac5190d",
"callback": func free_resources(args):
if not(len(args) == 2):
Client.display_message("Please enter an item type and quantity")
return false
var type = args[0]
var amount = int(args[1])
if not (type in Data.items):
Client.display_message("Unknown item type: " + type)
return
Client.player.get_node("Inventory").add(type, amount)
return true},
{
"hash": "8f1120f13067fb18ca2ee5bf7b57f9b8",
"callback": func(_args): set_var("max_craft_level")
},
{
"hash": "21a8297be0a2e4a39ec56a65015c0451",
"callback": func make_player_invincible(args):
var health = Client.player.get_node("Health")
health.invulnerable = not health.invulnerable
return health.invulnerable}
]
var CHEATS = {
"d10ba5f768ac9db04b8419a2590bce54": func explore_all_now(args):
var valence = toggle("explore_all")
for i in Procgen.systems:
Client.get_ui().get_node("Map").update_for_explore(i)
return valence,
"eba4a7a2f23a106e01e1380deac5190d": func free_resources(args):
if not(len(args) == 2):
Client.display_message("Please enter an item type and quantity")
return false
var type = args[0]
var amount = int(args[1])
if not (type in Data.items):
Client.display_message("Unknown item type: " + type)
return
Client.player.get_node("Inventory").add(type, amount)
return true,
"8f1120f13067fb18ca2ee5bf7b57f9b8": func(_args): return toggle("max_craft_level"),
"c7a90079bc623305b3e6382fb65774ad": func(_args): return toggle("jump_anywhere"),
"8694e6d17345b69e6075b8afb5e8c3ec": func enable_longjumps(_args):
var valence = toggle("longjump_enabled")
for i in Procgen.systems:
if Procgen.systems[i].explored:
Client.get_ui().get_node("Map").update_for_explore(i)
return valence,
"21a8297be0a2e4a39ec56a65015c0451": func make_player_invincible(args):
var health = Client.player.get_node("Health")
health.invulnerable = not health.invulnerable
return health.invulnerable
}

func set_var(variable_name):
func toggle(variable_name):
set(variable_name, not get(variable_name))
return get(variable_name)


func hash_code(code):
var ctx = HashingContext.new()
ctx.start(HashingContext.HASH_MD5)
Expand All @@ -56,12 +57,16 @@ func attempt_cheat(input):
var code = split[0].to_lower()
var args = split[1].trim_prefix(" ").split(" ") if split.size() > 1 else []
var hash = hash_code(code)

var valence: bool
for cheat in CHEATS:
if cheat.hash == hash:
valence = cheat.callback.call(args)
if valence:
Client.display_message("Cheat Enabled")
else:
Client.display_message("Cheat Disabled")
return

if hash in CHEATS:
valence = CHEATS[hash].call(args)
if valence:
Client.display_message("Cheat Enabled")
else:
Client.display_message("Cheat Disabled")
return
# else:
# Client.display_messages("Invalid cheat") I guess
# But cheats are supposed to be mysterious
28 changes: 27 additions & 1 deletion Client.gd
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ var player_name: String = "Shannon Merrol"

var typing: bool = false

var DEFAULT_UNLOCKED_CODEX = []

var unlocked_codex = []

func has_money(price):
return money >= price

Expand Down Expand Up @@ -76,7 +80,26 @@ func sel_sys(system_id, node):
# TODO: If we're in immediate jump mode, toggle out of the map and initiate a jump

func valid_jump_destination_selected():
return selected_system != current_system and selected_system != null
if not(selected_system != current_system and selected_system != null):
return false

if Cheats.jump_anywhere:
return true

var current_system_dat: SystemData = Procgen.systems[current_system]

if selected_system in current_system_dat.links_cache:
return true

if (Cheats.longjump_enabled or (
current_system_dat.longjump_enabled
or
Procgen.systems[selected_system].longjump_enabled
)) and selected_system in current_system_dat.long_links_cache:
return true

return false


func change_system():
var old_system = current_system
Expand Down Expand Up @@ -130,6 +153,9 @@ func current_biome() -> BiomeData:
return Data.biomes[Procgen.systems[current_system].biome]
else:
return BiomeData.new({})

func longjump_enabled():
return Cheats.longjump_enabled

func deserialize_entity(destination_path, serial_data):
var destination = get_world().get_node(destination_path)
Expand Down
10 changes: 10 additions & 0 deletions Util.gd
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,13 @@ func lead_correct_position(projectile_velocity: float, origin_position: Vector2,
func out_of_system_radius(node: Node3D, radius: float) -> bool:
return flatten_25d(node.global_position).length() >= radius

func clickable_spob(spob):
spob.input_event.connect(
func _on_input_event(_camera, event, _click_position, _camera_normal, _shape):
#https://stackoverflow.com/questions/58628154/detecting-click-touchscreen-input-on-a-3d-object-inside-godot
var mouse_click = event as InputEventMouseButton
if mouse_click and mouse_click.button_index == 1 and mouse_click.pressed:
Client.update_player_target_spob(spob)
else:
Client.mouseover_entered(spob)
)
4 changes: 3 additions & 1 deletion World3D.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ func enter_system(new_system):
var system: SystemData = Procgen.systems[new_system]
system.deserialize_entities() # Probably make this a method on World3D
SystemGen.do_spawns(Client.current_system_id().to_int() + Client.seed, system, $World3D)

var biome = Data.biomes[system.biome]
$background/Background.set_textures(biome.foreground, biome.background)

func leave_system(old_system):
# Don't free the player
Client.player.get_node("../").remove_child(Client.player)
Expand Down
2 changes: 1 addition & 1 deletion World3D.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
transform = Transform3D(0.707107, 0.5, -0.5, 0, 0.707107, 0.707107, 0.707107, -0.5, 0.5, -4.5, 6, 4.5)
projection = 1
current = true
size = 9.82505
size = 10.0
near = 0.01
far = 500.0
script = ExtResource("1_2by11")
Expand Down
Binary file added asset_sources/telescope.blend
Binary file not shown.
Binary file added asset_sources/trefoil.blend
Binary file not shown.
Binary file added asset_sources/workbench.blend
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://su2jdlal47cc"
path="res://.godot/imported/1024x1024 Blue Nebula 1.png-9db7da60d8f259771fb6cecdd8a09a41.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/ScreamingBrain/sharp_neb/Blue Nebula/1024x1024 Blue Nebula 1.png"
dest_files=["res://.godot/imported/1024x1024 Blue Nebula 1.png-9db7da60d8f259771fb6cecdd8a09a41.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://3fiqrkhwjboj"
path="res://.godot/imported/1024x1024 Blue Nebula 2.png-8279aa265efee9c7cf8b40d64995bd19.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/ScreamingBrain/sharp_neb/Blue Nebula/1024x1024 Blue Nebula 2.png"
dest_files=["res://.godot/imported/1024x1024 Blue Nebula 2.png-8279aa265efee9c7cf8b40d64995bd19.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bdrg4tag6yv84"
path="res://.godot/imported/1024x1024 Blue Nebula 3.png-8bde3130981563c45786b21591b53d40.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/ScreamingBrain/sharp_neb/Blue Nebula/1024x1024 Blue Nebula 3.png"
dest_files=["res://.godot/imported/1024x1024 Blue Nebula 3.png-8bde3130981563c45786b21591b53d40.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://qnq0cd65gbtd"
path="res://.godot/imported/1024x1024 Blue Nebula 5.png-8c5f01c87051880d33e1d52804ba000e.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/ScreamingBrain/sharp_neb/Blue Nebula/1024x1024 Blue Nebula 5.png"
dest_files=["res://.godot/imported/1024x1024 Blue Nebula 5.png-8c5f01c87051880d33e1d52804ba000e.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://w3ixe5bpynb"
path="res://.godot/imported/1024x1024 Blue Nebula 6.png-ee4da29a92af35c0f78d53a671dc2e60.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/ScreamingBrain/sharp_neb/Blue Nebula/1024x1024 Blue Nebula 6.png"
dest_files=["res://.godot/imported/1024x1024 Blue Nebula 6.png-ee4da29a92af35c0f78d53a671dc2e60.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b26d899

Please sign in to comment.