Game data commit

This commit is contained in:
Segey Lapin
2019-07-17 16:01:38 +03:00
parent 6b063cb729
commit 16de47d454
97 changed files with 3092 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
source_md5="b73fecbb785063142aeca834ad878828"
dest_md5="2486a6b1205defef85f44204f732d099"

View File

@@ -0,0 +1,3 @@
source_md5="c164948c4cfeae5a607495e00be8ca66"
dest_md5="9d3d4aa9ef2658a6128ac5e4e915b461"

View File

@@ -0,0 +1,3 @@
source_md5="273e9ad17bea5e1875ff88736b2c1aab"
dest_md5="64083f610bb464dcd8b88bb210848264"

View File

@@ -0,0 +1,3 @@
source_md5="15dc5987dc50c8d752ab05bac34b9292"
dest_md5="969146a477e8e2b7a8ad6211e740644b"

View File

@@ -0,0 +1,3 @@
source_md5="e3a2c32b4b53b7b47d80f79f6156800c"
dest_md5="ec085f91684f6769e56fc9521bfbec75"

View File

@@ -0,0 +1,3 @@
source_md5="62d2718b027012eb0c3b9b5d6b3851dd"
dest_md5="5c41e568797c2a17b2a4e7488f90e5ad"

View File

@@ -0,0 +1,3 @@
source_md5="9b2cd5fc50b20bce2b1eba9a6ca5cf1f"
dest_md5="80505aff432129f227696942859dd33b"

View File

@@ -0,0 +1,3 @@
source_md5="c19f98ca789ec90e4108f525d43f3df4"
dest_md5="75a79f8b38675761217f44bd89a0f150"

View File

@@ -0,0 +1,3 @@
source_md5="a56b1a90c3513c74f88a0ba9d6a337bd"
dest_md5="316ddbf1bebf1ce324c4e9bb7dfe9cac"

View File

@@ -0,0 +1,3 @@
source_md5="541f1b24669764dbc5b15a4d449e8247"
dest_md5="d0dfbc14cb03651f4b9476a7ea0c16be"

View File

@@ -0,0 +1,3 @@
source_md5="f89abe62215e40dec4d546f063601b0a"
dest_md5="3e2201920e89a95536543eb333a8ba3b"

View File

@@ -0,0 +1,3 @@
source_md5="c54a5449e3860abff8dbb24e0d4fa384"
dest_md5="37ad1b844572193a1b8f7f235781a70e"

View File

@@ -0,0 +1,3 @@
source_md5="401c9cd7a82b64de412b1ad9a004c6db"
dest_md5="2bca0dc7fa291be120e0a0bfcaa9653a"

View File

@@ -0,0 +1,3 @@
source_md5="4bf65c987eed1d8a0106039ccae34adc"
dest_md5="44d77d9b89abc5d560a6ddbbd012eaae"

View File

@@ -0,0 +1,3 @@
source_md5="ea50c5c10ac2e3fbc3fb694064dc6db7"
dest_md5="e8f7e370227c4c7868a62835cdabcdab"

View File

@@ -0,0 +1,3 @@
source_md5="c510b4724c871c6aa15433f939fc48fe"
dest_md5="973ab80066256690477f9d628e6a0b65"

View File

@@ -0,0 +1,3 @@
source_md5="177e3ae4712c152f92a45eb287c51244"
dest_md5="5274f78edd2b4d7ab9276002c71ab3bc"

265
proto1/ai/ball_game_ai.gd Normal file
View File

@@ -0,0 +1,265 @@
extends Node
class_name BallGameAI
var _ball: PackedScene
var _cheers = {}
var _game_area: Rect2
var _teams = {}
var _main
var _state = STATE_INIT
var _ball_instance
var _cheer_locations = {}
var _team_start = {}
var _ball_carrier = null
var _ball_team = -1
var ch2team: Dictionary = {}
var gate2team = {}
var _gates = {}
var _scores = {}
enum {STATE_INIT, STATE_START, STATE_RUNNING, STATE_FINISH}
func _ready():
_game_area = Rect2()
func set_ball(ball: PackedScene):
_ball = ball
func add_player(team: int, pl: Dictionary):
if !_teams.has(team):
_teams[team] = [pl]
else:
_teams[team].push_back(pl)
assert pl != null
ch2team[pl.scene] = team
func add_cheer(team: int, ch: Dictionary):
if !_cheers.has(team):
_cheers[team] = [ch]
else:
_cheers[team].push_back(ch)
assert ch != null
ch2team[ch.scene] = team
func add_cheer_game_location(team: int, loc: Vector2):
if !_cheer_locations.has(team):
_cheer_locations[team] = [loc]
else:
_cheer_locations[team].push_back(loc)
_game_area = _game_area.expand(loc)
func set_team_start(team: int, v: Vector2):
_team_start[team] = v
_game_area = _game_area.expand(v)
func set_team_gate(team: int, gate: Area2D):
_gates[team] = gate
gate2team[gate] = team
gate.connect("body_entered", self, "check_goal", [gate])
_game_area = _game_area.expand(gate.global_position)
func set_main(n):
_main = n
func start_game():
var ball = _ball.instance()
_main.add_child(ball)
ball.global_position = world.master_node.global_position + Vector2(randf() - 0.5, randf() - 0.5) * 20.0
ball.add_to_group("ball")
_state = STATE_START
for t in _teams.keys():
for ch in _teams[t]:
ch.scene.walkto(_team_start[t])
var loc = 0
for t in _cheers.keys():
for ch in _cheers[t]:
ch.scene.walkto(_cheer_locations[t][loc % _cheer_locations[t].size()])
loc += 1
_ball_instance = ball
for t in _teams.keys():
_scores[t] = 0
func stop_game():
for k in get_tree().get_nodes_in_group("ball"):
k.queue_free()
_state = STATE_INIT
var max_score = -1
var winner_team = -1
for k in _scores.keys():
if _scores[k] > max_score:
max_score = _scores[k]
winner_team = k
for e in _teams[winner_team]:
world.increase_xp(e, min(e.xp * 2, min(100 * e.level, 1000)))
for e in _cheers[winner_team]:
world.increase_xp(e, min(e.xp * 2, min(200 * e.level, 2000)))
var base_speed = 300.0
func striker(ch: Dictionary, delta: float) -> Vector2:
var velocity: Vector2 = Vector2()
var dir = Vector2()
if _ball_carrier == null:
dir = _ball_instance.global_position - ch.scene.global_position
else:
dir = _ball_carrier.scene.global_position - ch.scene.global_position
velocity = dir.normalized() * base_speed * ch.speed
return velocity
func avoid(ch: Dictionary, delta: float) -> Vector2:
var velocity: Vector2 = Vector2()
var vel_plus = Vector2()
var team = ch2team[ch.scene]
var ch_pos = ch.scene.global_position
for t in _teams.keys():
if t == team:
continue
for other in _teams[t]:
var opos = other.scene.global_position
var lvec = ch_pos - opos
vel_plus += lvec
velocity = vel_plus.normalized() * base_speed * ch.speed * (1.0 + ch.agression)
return velocity
func attack_gate(ch: Dictionary, delta: float) -> Vector2:
var velocity: Vector2 = Vector2()
var team = ch2team[ch.scene]
var dir = _gates[team ^ 1].global_position - ch.scene.global_position
if dir.length() > 80:
velocity = dir.normalized() * base_speed * ch.speed * (1.0 + ch.agression)
elif dir.length() > 40:
velocity = dir.normalized() * base_speed * ch.speed * 0.6 * (1.0 + ch.agression)
elif dir.length() > 25:
velocity = dir.normalized() * base_speed * ch.speed * 0.25 * (1.0 + ch.agression)
return velocity
var catch_delay = 0.0
func catch_ball(pl):
_ball_instance.kinematic = true
_ball_instance.new_parent = pl.scene
_ball_instance.update = true
_ball_instance.impulse = Vector2()
_ball_carrier = pl
var max_imp = 500.0
func drop_ball(pl):
assert _main != null
_ball_instance.kinematic = false
_ball_instance.new_parent = _main
_ball_instance.update = true
_ball_instance.impulse = _ball_carrier.scene.velocity * _ball_instance.mass * (1.5 + randf() * 10.0)
if _ball_instance.impulse.length() > max_imp:
_ball_instance.impulse = _ball_instance.impulse.normalized() * max_imp
_ball_carrier = null
func check_goal(body, gate):
print("check")
if _state == STATE_RUNNING:
var team = gate2team[gate]
if body is RigidBody2D:
if body == _ball_instance:
_scores[team] += 1
elif body is KinematicBody2D && _ball_carrier != null:
print("check2")
if body == _ball_carrier.scene:
world.increase_xp(_ball_carrier, 150)
_scores[team] += 1
catch_delay += 3.0
drop_ball(_ball_carrier)
print(_scores)
func colliding(delta):
var close_distance2 = 450.0
var chars = {}
for t in _teams.keys():
for e in _teams[t]:
chars[e.scene] = e
for t in _cheers.keys():
for e in _cheers[t]:
chars[e.scene] = e
for p in chars.keys():
var pos1 = chars[p].scene.global_position
var v1 = chars[p].scene.velocity
var strength = chars[p].strength
if chars[p] == _ball_carrier:
strength *= 5.0
for m in chars.keys():
if p == m:
continue
var pos2 = chars[m].scene.global_position
var dist = pos1.distance_squared_to(pos2)
var v2 = chars[m].scene.velocity
if dist < close_distance2:
if v1.dot(v2) < 0:
if strength > chars[m].strength:
chars[p].scene.velocity = chars[p].scene.velocity.linear_interpolate((v1 + v2) * 0.5, delta)
chars[m].scene.velocity = chars[p].scene.velocity.linear_interpolate((v1 + v2) * 0.5, delta)
else:
chars[p].scene.velocity = Vector2()
elif v1.dot(v2) >= 0:
if v1.length() > v2.length():
if strength > chars[m].strength:
chars[p].scene.velocity = chars[p].scene.velocity.linear_interpolate((v1 + v2) * 0.5, delta)
chars[m].scene.velocity = chars[p].scene.velocity.linear_interpolate((v1 + v2) * 0.5, delta)
var start_delay = 15.0
func _process(delta):
match(_state):
STATE_INIT:
pass
STATE_START:
var ok_to_run = true
for c in _teams.keys():
for pl in _teams[c]:
var ppos = pl.scene.global_position
var bpos = _team_start[c]
if ppos.distance_to(bpos) < 40:
pl.scene.state = pl.scene.STATE_CONTROL
elif ppos.distance_to(bpos) > 60 && pl.scene.state != pl.scene.STATE_CONTROL:
ok_to_run = false
if ok_to_run:
_state = STATE_RUNNING
for c in _teams.keys():
for pl in _teams[c]:
pl.scene.state = pl.scene.STATE_CONTROL
else:
if start_delay < 0.0:
for c in _teams.keys():
for pl in _teams[c]:
var ppos = pl.scene.global_position
var bpos = _team_start[c]
if ppos.distance_to(bpos) > 60 && pl.scene.state != pl.scene.STATE_CONTROL:
pl.scene.global_position = _team_start[c]
for c in _cheers.keys():
for pl in _cheers[c]:
var ppos = pl.scene.global_position
var bpos = pl.scene.destination
if ppos.distance_to(bpos) > 60 && pl.scene.state != pl.scene.STATE_CONTROL:
pl.scene.global_position = _team_start[c]
else:
start_delay -= delta
STATE_RUNNING:
for c in _teams.keys():
for pl in _teams[c]:
assert pl.scene != null
if !_ball_carrier || (pl != _ball_carrier && _ball_team != c):
var velocity = striker(pl, delta)
velocity = pl.scene.velocity.linear_interpolate(velocity, 0.3 * delta)
# velocity = pl.scene.move_and_slide(velocity)
pl.scene.velocity = velocity
elif _ball_carrier && _ball_carrier == pl:
var velocity = avoid(pl, delta) * 0.3 + attack_gate(pl, delta) * 0.7
velocity = pl.scene.velocity.linear_interpolate(velocity, 0.6 * delta)
# velocity = pl.scene.move_and_slide(velocity)
pl.scene.velocity = velocity
if _ball_carrier == null && pl.scene.global_position.distance_squared_to(_ball_instance.global_position) < 350 * (1.0 + pl.agression):
if catch_delay <= 0.0:
catch_ball(pl)
_ball_team = c
world.increase_xp(pl, 50)
elif _ball_carrier && pl != _ball_carrier && pl.scene.global_position.distance_squared_to(_ball_carrier.scene.global_position) < 350 * (1.0 + pl.agression):
if pl.strength * (1.0 + pl.agression) > _ball_carrier.strength * 1.2 * (1.0 + _ball_carrier.agression):
world.increase_xp(pl, 50)
drop_ball(_ball_carrier)
catch_delay += 5.0
colliding(delta)
for c in _teams.keys():
for pl in _teams[c]:
pl.scene.velocity = pl.scene.move_and_slide(pl.scene.velocity + Vector2(randf() - 0.5, randf() - 0.5) * 3.0)
if !_game_area.has_point(_ball_instance.global_position):
if !_ball_carrier:
_ball_instance.queue_free()
_ball_instance = _ball.instance()
_main.add_child(_ball_instance)
_ball_instance.global_position = world.master_node.global_position + Vector2(randf() - 0.5, randf() - 0.5) * 20.0
_ball_instance.add_to_group("ball")
catch_delay += 5.0
else:
drop_ball(_ball_carrier)
catch_delay += 5.0
if catch_delay > 0.0:
catch_delay -= delta

147
proto1/autoloads/world.gd Normal file
View File

@@ -0,0 +1,147 @@
extends Node
signal room_event
signal next_day
signal next_period
signal level_up
var money: int = 2000
var master_node
var current_room
var team = {}
var cheer_team = {}
var room_events = {}
var line = {}
var training = false
func room_event(ev: String):
if current_room:
if room_events.has(current_room.name):
if room_events[current_room.name].has(ev):
var evdata = room_events[current_room.name][ev]
evdata.obj.call_deferred(evdata.fname, evdata.name)
func register_room_event(roomobj, evname, fname):
if !room_events.has(roomobj.name):
room_events[roomobj.name] = {}
room_events[roomobj.name][evname] = {"obj": roomobj, "name": evname, "fname": fname}
func _ready():
connect("room_event", self, "room_event")
func new_candidate() -> Dictionary:
var gender = randi() % 2
var type = 0
if gender == 0:
type = 0
else:
type = randi() % 2
var ret = {}
if gender == 0:
ret.name = "John"
ret.lastname = "Doe"
else:
ret.name = "Jane"
ret.lastname = "Doe"
ret.type = type
ret.speed = 0.3 + randf() * 0.7
ret.strength = 0.1 + randf() * 0.9
ret.agression = 0.1 + randf() * 0.9
ret.charisma = 0.1 + randf() * 0.9
ret.obedience = 0.1 + randf() * 0.9
if type == 0:
ret.cost = 2 + int(randf() * 20.0 * (ret.speed + ret.strength + ret.agression) / 3.0)
else:
ret.cost = 2 + int(randf() * 20.0 * (ret.speed + ret.strength + ret.charisma) / 3.0)
ret.xp = 0
ret.next_xp = 100
ret.points = 5
ret.level = 1
return ret
func auto_points(ch):
while ch.points > 0:
ch.points -= 1
var choice = randi() % 5
match(choice):
0:
if ch.type == 0:
ch.strength += 0.15
else:
ch.charisma += 0.15
1:
ch.speed += 0.2
2:
ch.agression += 0.2
3:
ch.obedience += 0.2
4:
if ch.type == 1:
ch.strength += 0.05
else:
ch.charisma += 0.05
func level_up(ch):
emit_signal("level_up", ch)
ch.points += 1 + randi() % 5
if ch.level < 20:
ch.next_xp *= 2
elif ch.level < 60:
ch.next_xp += (10 + ch.level) * 1000
else:
ch.next_xp += (20 + ch.level) * 2000
ch.level += 1
print("level up!, new level: ", ch.level, " next xp: ", ch.next_xp)
auto_points(ch)
func increase_xp(ch, num):
ch.xp += num
print("added ", num, " xp, xp = ", ch.xp)
if ch.xp >= ch.next_xp:
level_up(ch)
else:
print("next at ", ch.next_xp)
func init_data():
for ci in range(12):
var cd : = new_candidate()
line[ci] = cd
team = {}
cheer_team = {}
print(line)
func dialogue(npc):
pass
var day_period = 0
var day = 1
func next_day():
day += 1
emit_signal("next_day")
func next_period():
day_period += 1
emit_signal("next_period")
if day_period == 4:
day_period = 0
next_day()
func action1():
print("action1")
var obj = null
var dstc = 0.0
for k in get_tree().get_nodes_in_group("act") + get_tree().get_nodes_in_group("npc"):
if obj == null:
obj = k
dstc = master_node.global_position.distance_squared_to(obj.global_position)
continue
var dst = master_node.global_position.distance_squared_to(k.global_position)
if dstc > dst:
obj = k
dstc = master_node.global_position.distance_squared_to(obj.global_position)
continue
if obj && dstc < 400.0:
print("action1 obj")
if obj.is_in_group("npc"):
dialogue(obj)
else:
obj.call_deferred("activate")
else:
print("action1 room")
emit_signal("room_event", "action1")

46
proto1/ball.gd Normal file
View File

@@ -0,0 +1,46 @@
extends RigidBody2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
var update = false
var kinematic = false
var new_parent
var new_position
var impulse = Vector2()
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _physics_process(delta):
if update:
if new_position:
if mode == RigidBody2D.MODE_KINEMATIC:
global_position = new_position
else:
apply_impulse(Vector2(), (new_position - global_position) * mass)
new_position = null
elif kinematic:
mode = RigidBody2D.MODE_KINEMATIC
collision_mask = 0
collision_layer = 2
position = Vector2()
if get_parent() && new_parent:
get_parent().remove_child(self)
new_parent.add_child(self)
else:
mode = MODE_RIGID
collision_mask = 1
collision_layer = 1
var old_pos = global_position
if get_parent() && new_parent:
get_parent().remove_child(self)
new_parent.add_child(self)
global_position = old_pos
apply_impulse(Vector2(), impulse)
update = false

19
proto1/ball.tscn Normal file
View File

@@ -0,0 +1,19 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ball.gd" type="Script" id=1]
[sub_resource type="CircleShape2D" id=1]
radius = 6.0
[node name="ball" type="RigidBody2D"]
collision_mask = 17
mass = 3.0
gravity_scale = 0.0
script = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
[node name="Polygon2D" type="Polygon2D" parent="."]
color = Color( 0.192157, 0.101961, 0.101961, 1 )
polygon = PoolVector2Array( -5.61243, -1.47311, -4.4319, -3.5564, -2.00139, -5.5008, 2.37351, -5.57025, 4.52625, -3.48696, 5.56789, -1.54255, 5.22067, 2.48514, 3.27628, 4.91564, -0.473648, 6.37394, -3.66802, 4.8462, -5.82076, 1.44349 )

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/TEMPLATE.png-4aefaed29f7863a884d987bb23ddc0ea.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://characters/TEMPLATE.png"
dest_files=[ "res://.import/TEMPLATE.png-4aefaed29f7863a884d987bb23ddc0ea.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/TEMPLATE_improved.png-29596b1dfb88bba12c6086752978aa4d.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://characters/TEMPLATE_improved.png"
dest_files=[ "res://.import/TEMPLATE_improved.png-29596b1dfb88bba12c6086752978aa4d.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

22
proto1/dialogue.tscn Normal file
View File

@@ -0,0 +1,22 @@
[gd_scene format=2]
[node name="dialogue" type="Node2D"]
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="buttons" type="HBoxContainer" parent="CanvasLayer"]
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = -80.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="actions" type="VBoxContainer" parent="CanvasLayer/buttons"]
margin_right = 12.0
margin_bottom = 80.0
[node name="follow" type="Button" parent="CanvasLayer/buttons/actions"]
margin_right = 12.0
margin_bottom = 20.0

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,13 @@
Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -0,0 +1,92 @@
This Font Software is licensed under the SIL Open Font License,
Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font
creation efforts of academic and linguistic communities, and to
provide a free and open framework in which fonts may be shared and
improved in partnership with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply to
any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software
components as distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to,
deleting, or substituting -- in part or in whole -- any of the
components of the Original Version, by changing formats or by porting
the Font Software to a new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed,
modify, redistribute, and sell modified and unmodified copies of the
Font Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components, in
Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the
corresponding Copyright Holder. This restriction only applies to the
primary font name as presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created using
the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@@ -0,0 +1,45 @@
The work in the Hack project is Copyright 2018 Source Foundry Authors and licensed under the MIT License
The work in the DejaVu project was committed to the public domain.
Bitstream Vera Sans Mono Copyright 2003 Bitstream Inc. and licensed under the Bitstream Vera License with Reserved Font Names "Bitstream" and "Vera"
### MIT License
Copyright (c) 2018 Source Foundry Authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
### BITSTREAM VERA LICENSE
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions:
The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces.
The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera".
This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names.
The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

123
proto1/hire_fire.gd Normal file
View File

@@ -0,0 +1,123 @@
extends WindowDialog
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func build_lists():
$VBoxContainer/player_list.clear()
for k in world.line.keys():
var item_text: String = world.line[k].name
item_text += " " + world.line[k].lastname
item_text += " STR: " + str(int(world.line[k].strength * 100.0))
item_text += " Cost/day: " + str(world.line[k].cost)
if world.line[k].type == 0:
item_text += " team"
else:
item_text += " cheerleader"
var idx = $VBoxContainer/player_list.get_item_count()
$VBoxContainer/player_list.add_item(item_text)
$VBoxContainer/player_list.set_item_metadata(idx, {"id": k})
$VBoxContainer/team_list.clear()
for k in world.team.keys():
var item_text: String = world.team[k].name
item_text += " " + world.team[k].lastname
item_text += " STR: " + str(int(world.team[k].strength * 100.0))
item_text += " Cost/day: " + str(world.team[k].cost)
item_text += " team"
var idx = $VBoxContainer/team_list.get_item_count()
$VBoxContainer/team_list.add_item(item_text)
$VBoxContainer/team_list.set_item_metadata(idx, {"id": k, "type": world.team[k].type})
for k in world.cheer_team.keys():
var item_text: String = world.cheer_team[k].name
item_text += " " + world.cheer_team[k].lastname
item_text += " STR: " + str(int(world.cheer_team[k].strength * 100.0))
item_text += " Cost/day: " + str(world.cheer_team[k].cost)
item_text += " cheerleader"
var idx = $VBoxContainer/team_list.get_item_count()
$VBoxContainer/team_list.add_item(item_text)
$VBoxContainer/team_list.set_item_metadata(idx, {"id": k, "type": world.cheer_team[k].type})
func hire_candidate():
var sel: PoolIntArray = $VBoxContainer/player_list.get_selected_items()
if sel.size() == 0:
return
var idx = sel[0]
var meta: Dictionary = $VBoxContainer/player_list.get_item_metadata(idx)
var cd = world.line[meta.id]
if cd.type == 0:
var teamkeys = world.team.keys()
var newkey = 0
if teamkeys.size() > 0:
var maxkey = teamkeys.max()
newkey = maxkey + 1
var char_sc = load("res://npc_player.tscn").instance()
cd.scene = char_sc
get_tree().get_root().add_child(char_sc)
var nav: Navigation2D = get_node("/root/main/nav")
var p = nav.get_closest_point(get_node("/root/main/dormitory_players").global_position + Vector2(randf() * 100.0 - 50.0, randf() * 100 - 50.0))
char_sc.position = p
world.team[newkey] = cd
world.line.erase(meta.id)
build_lists()
update()
else:
var teamkeys = world.cheer_team.keys()
var newkey = 0
if teamkeys.size() > 0:
var maxkey = teamkeys.max()
newkey = maxkey + 1
var char_sc = load("res://npc_cheer.tscn").instance()
cd.scene = char_sc
get_tree().get_root().add_child(char_sc)
var nav: Navigation2D = get_node("/root/main/nav")
var p = nav.get_closest_point(get_node("/root/main/dormitory_cheer").global_position + Vector2(randf() * 100.0 - 50.0, randf() * 100 - 50.0))
char_sc.position = p
world.cheer_team[newkey] = cd
world.line.erase(meta.id)
build_lists()
update()
func hire_all():
for k in world.line.keys():
var cd = world.line[k]
if cd.type == 0:
var teamkeys = world.team.keys()
var newkey = 0
if teamkeys.size() > 0:
var maxkey = teamkeys.max()
newkey = maxkey + 1
var char_sc = load("res://npc_player.tscn").instance()
cd.scene = char_sc
get_tree().get_root().add_child(char_sc)
var nav: Navigation2D = get_node("/root/main/nav")
var p = nav.get_closest_point(get_node("/root/main/dormitory_players").global_position + Vector2(randf() * 100.0 - 50.0, randf() * 100 - 50.0))
char_sc.position = p
world.team[newkey] = cd
world.line.erase(k)
else:
var teamkeys = world.cheer_team.keys()
var newkey = 0
if teamkeys.size() > 0:
var maxkey = teamkeys.max()
newkey = maxkey + 1
var char_sc = load("res://npc_cheer.tscn").instance()
cd.scene = char_sc
get_tree().get_root().add_child(char_sc)
var nav: Navigation2D = get_node("/root/main/nav")
var p = nav.get_closest_point(get_node("/root/main/dormitory_cheer").global_position + Vector2(randf() * 100.0 - 50.0, randf() * 100 - 50.0))
char_sc.position = p
world.cheer_team[newkey] = cd
world.line.erase(k)
cd.scene.set_meta("data", cd)
build_lists()
update()
func _ready():
$VBoxContainer/close.connect("pressed", self, "hide")
connect("about_to_show", self, "build_lists")
$VBoxContainer/buttons/hire.connect("pressed", self, "hire_candidate")
$VBoxContainer/buttons/hire_all.connect("pressed", self, "hire_all")
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/roguelikeIndoor_magenta.png-6c87851f145cc2ba6ab449e4967e9c58.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://interior/Tilesheets/roguelikeIndoor_magenta.png"
dest_files=[ "res://.import/roguelikeIndoor_magenta.png-6c87851f145cc2ba6ab449e4967e9c58.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/roguelikeIndoor_transparent.png-111e4fc59e78208dd75f74252be62c7c.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://interior/Tilesheets/roguelikeIndoor_transparent.png"
dest_files=[ "res://.import/roguelikeIndoor_transparent.png-111e4fc59e78208dd75f74252be62c7c.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/minitileset.png-605d46bdb06b22f17693c7bd859b9daf.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://interior/minitileset.png"
dest_files=[ "res://.import/minitileset.png-605d46bdb06b22f17693c7bd859b9daf.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/tiles_final_col1.png-21f3bdc3f468a8f25e9c9616a4e8c1a9.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://interior/tiles_final_col1.png"
dest_files=[ "res://.import/tiles_final_col1.png-21f3bdc3f468a8f25e9c9616a4e8c1a9.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/tiles_final_col10.png-b9da5122a952011d20f7e1fcd1a47476.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://interior/tiles_final_col10.png"
dest_files=[ "res://.import/tiles_final_col10.png-b9da5122a952011d20f7e1fcd1a47476.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/tiles_final_col11.png-2429aa813abf65462f277205e61df7cc.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://interior/tiles_final_col11.png"
dest_files=[ "res://.import/tiles_final_col11.png-2429aa813abf65462f277205e61df7cc.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/tiles_final_col2.png-c8b4f41718fa25cf1d766981428f7cd1.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://interior/tiles_final_col2.png"
dest_files=[ "res://.import/tiles_final_col2.png-c8b4f41718fa25cf1d766981428f7cd1.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/tiles_final_col3.png-3250ba7566e0d68054aa6f9572062383.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://interior/tiles_final_col3.png"
dest_files=[ "res://.import/tiles_final_col3.png-3250ba7566e0d68054aa6f9572062383.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/tiles_final_col4.png-885ffbcdcfdaf68b0824edb09b44fdb0.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://interior/tiles_final_col4.png"
dest_files=[ "res://.import/tiles_final_col4.png-885ffbcdcfdaf68b0824edb09b44fdb0.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/tiles_final_col5.png-698629453590d90e7248a255229ea257.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://interior/tiles_final_col5.png"
dest_files=[ "res://.import/tiles_final_col5.png-698629453590d90e7248a255229ea257.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/tiles_final_col6.png-9c8f85e5423c90a7b91d03ab954d4c20.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://interior/tiles_final_col6.png"
dest_files=[ "res://.import/tiles_final_col6.png-9c8f85e5423c90a7b91d03ab954d4c20.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/tiles_final_col7.png-ee7c1366c82ffa3664c1fae429041d45.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://interior/tiles_final_col7.png"
dest_files=[ "res://.import/tiles_final_col7.png-ee7c1366c82ffa3664c1fae429041d45.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/tiles_final_col8.png-57d6ec72145d38b59d5cab1c6e2e0fbb.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://interior/tiles_final_col8.png"
dest_files=[ "res://.import/tiles_final_col8.png-57d6ec72145d38b59d5cab1c6e2e0fbb.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/tiles_final_col9.png-a5aaeb2be4a595b4634b950c2084dc3a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://interior/tiles_final_col9.png"
dest_files=[ "res://.import/tiles_final_col9.png-a5aaeb2be4a595b4634b950c2084dc3a.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/tiles_final_sw.png-ac9984ccd9803d547dcaa4b6488dca26.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://interior/tiles_final_sw.png"
dest_files=[ "res://.import/tiles_final_sw.png-ac9984ccd9803d547dcaa4b6488dca26.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

80
proto1/main.gd Normal file
View File

@@ -0,0 +1,80 @@
extends Node2D
var nav: Navigation2D
var ball_game
func hire_fire(rname, evt):
$CanvasLayer/uis/hire_fire.popup()
func start_training(rname, evt):
if world.training:
print("stop training")
ball_game.stop_game()
ball_game.queue_free()
# for k in get_tree().get_nodes_in_group("ball"):
# k.queue_free()
for k in world.team.keys():
var ch = world.team[k]
var dst = $shower_players.global_position + Vector2(randf() * 20.0, randf() * 20.0)
ch.scene.walkto(dst)
for k in world.cheer_team.keys():
var ch = world.cheer_team[k]
var dst = $shower_cheer.global_position + Vector2(randf() * 20.0, randf() * 20.0)
ch.scene.walkto(dst)
world.training = false
world.next_period()
else:
ball_game = BallGameAI.new()
add_child(ball_game)
ball_game.set_main(self)
ball_game.set_ball(load("res://ball.tscn"))
print("start training")
for k in world.team.keys():
var ch = world.team[k]
ball_game.add_player(randi() % 2, ch)
# var dst = ball.global_position + Vector2(randf() - 0.5, randf() - 0.5) * 10.0
# ch.scene.follow(ball)
var cheer_dst = $gym.global_position + Vector2((randf() - 0.5) * 30.0, (randf() - 0.5) * 30.0)
var team_point_nodes = [$gym/game_points/team0, $gym/game_points/team1]
for en in range(team_point_nodes.size()):
var e = team_point_nodes[en]
for c in e.get_children():
if c.name.begins_with("cheer"):
ball_game.add_cheer_game_location(en, c.global_position)
elif c.name == "start":
ball_game.set_team_start(en, c.global_position)
elif c.name == "gate":
ball_game.set_team_gate(en, c)
for k in world.cheer_team.keys():
var ch = world.cheer_team[k]
ball_game.add_cheer(randi() % 2, ch)
# var dst = $gym.global_position + Vector2((randf() - 0.5) * 30.0, (randf() - 0.5) * 30.0)
# ch.scene.walkto(dst)
ball_game.start_game()
world.training = true
func visit_players_dressing(rname, evt):
pass
func visit_cheer_dressing(rname, evt):
pass
func visit_players_shower(rname, evt):
pass
func visit_cheer_shower(rname, evt):
pass
func visit_players_dormitory(rname, evt):
pass
func visit_cheer_dormitory(rname, evt):
pass
func visit_closet(rname, evt):
pass
func update_day():
$CanvasLayer/uis/HBoxContainer/day.text = "day: " + str(world.day)
func _ready():
$office.connect("room_event", self, "hire_fire")
$gym.connect("room_event", self, "start_training")
world.connect("next_day", self, "update_day")
nav = $nav
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if world.training:
for k in ball_game._scores.keys():
if ball_game._scores[k] > 3.0:
start_training("gym", "action1")

1134
proto1/main.tscn Normal file

File diff suppressed because one or more lines are too long

20
proto1/master.gd Normal file
View File

@@ -0,0 +1,20 @@
extends KinematicBody2D
var motion : = Vector2()
enum {STATE_NORMAL, STATE_DIALOGUE}
var state = STATE_NORMAL
func _ready():
world.master_node = self
func _physics_process(delta):
match(state):
STATE_NORMAL:
var horizontal: float = Input.get_action_strength("move_east") - Input.get_action_strength("move_west")
var vertical: float = Input.get_action_strength("move_south") - Input.get_action_strength("move_north")
motion = Vector2(horizontal, vertical) * 140.5
motion = move_and_slide(motion)
func _process(delta):
match(state):
STATE_NORMAL:
if Input.is_action_just_pressed("action1"):
world.action1()

21
proto1/master.tscn Normal file
View File

@@ -0,0 +1,21 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://characters/TEMPLATE_improved.png" type="Texture" id=1]
[ext_resource path="res://master.gd" type="Script" id=2]
[sub_resource type="CapsuleShape2D" id=1]
radius = 5.75409
height = 7.27898
[node name="master" type="KinematicBody2D"]
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )
offset = Vector2( 0, -16 )
region_enabled = true
region_rect = Rect2( 24, 64, 24, 32 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 0.237808, -8.08611 )
shape = SubResource( 1 )

132
proto1/npc.gd Normal file
View File

@@ -0,0 +1,132 @@
extends KinematicBody2D
signal arrived
enum {STATE_IDLE, STATE_WALKTO, STATE_DIALOGUE, STATE_FOLLOW, STATE_CONTROL}
var destination = Vector2()
var state = STATE_IDLE
var velocity = Vector2()
var next_dst = Vector2()
var nav: Navigation2D
var arrived = false
var dst_node
func _ready():
nav = get_node("/root/main/nav")
add_to_group("npc")
func calc_next_dst():
var path = nav.get_simple_path(nav.get_closest_point(global_position), nav.get_closest_point(destination))
if path.size() > 1:
var ok = false
for p in path:
if global_position.distance_squared_to(p) >= 25.0:
next_dst = p
ok = true
break
if !ok:
if global_position.distance_squared_to(destination) < 25.0:
next_dst = destination
else:
next_dst = global_position + (destination - global_position).normalized() * 20.0 + Vector2(randf() - 0.5, randf() - 0.5) * 40.0
else:
next_dst = destination
func update_destination():
destination = dst_node.global_position
func walkto(p: Vector2):
arrived = false
destination = p
state = STATE_WALKTO
calc_next_dst()
func follow(n: Node2D):
arrived = false
state = STATE_FOLLOW
dst_node = n
update_destination()
calc_next_dst()
func avoidance(delta):
var avdst = 800.0
var velsum = Vector2()
for n in get_tree().get_nodes_in_group("npc"):
if n == self:
continue
var dist = n.global_position.distance_squared_to(global_position)
if dist < avdst:
var d = global_position - n.global_position
velsum += d
velocity = velocity.linear_interpolate(velsum.normalized() * velocity.length() + Vector2(randf() - 0.5, randf() - 0.5) * velocity.length() * 0.3, delta)
func flock(delta):
var avdst = 3600.0
var maxdst = 10000.0
var velsum = Vector2()
for n in get_tree().get_nodes_in_group("npc"):
if n == self:
continue
var dist = n.global_position.distance_squared_to(global_position)
if dist > avdst && dist < maxdst:
var d = global_position - n.global_position
velsum += -d
velocity = velocity.linear_interpolate(velsum.normalized() * velocity.length() + Vector2(randf() - 0.5, randf() - 0.5) * velocity.length() * 0.3, delta)
func attack():
var bodies = $capture.get_overlapping_bodies()
for b in bodies:
if b is RigidBody2D:
var e = velocity
if e.length() == 0:
e = Vector2(randf() - 0.5, randf() - 0.5)
b.apply_impulse(Vector2(), e.normalized() * (100.0 + 100.0 * randf()))
elif b.is_in_group("npc"):
var e = velocity * 2.0
if e.length() == 0:
e = Vector2(randf() - 0.5, randf() - 0.5) * 5000.0
b.velocity = e
b.move_and_slide(e)
func _process(delta):
match(state):
STATE_IDLE:
if randf() > 0.99:
velocity = velocity.linear_interpolate(Vector2(randf() * 300.0 - 150.0, randf() * 300.0 - 150.0), 0.1 + delta * 0.9)
else:
velocity = velocity.linear_interpolate(Vector2(), delta)
avoidance(delta)
flock(delta)
velocity = move_and_slide(velocity)
STATE_WALKTO:
var vel_base = 540.0
if global_position.distance_squared_to(next_dst) < 25.0:
calc_next_dst()
if global_position.distance_squared_to(next_dst) < 900.0:
vel_base = 160.0
var dir = (next_dst - position).normalized()
velocity = velocity.linear_interpolate(dir * vel_base, 0.3 * delta)
avoidance(delta)
flock(delta)
if velocity.length() < 3.0:
velocity += Vector2(randf() - 0.5, randf() - 0.5) * 6.0
attack()
velocity = move_and_slide(velocity)
if global_position.distance_squared_to(destination) < 25.0:
emit_signal("arrived", destination)
state = STATE_IDLE
arrived = true
STATE_FOLLOW:
var vel_base = 540.0
update_destination()
calc_next_dst()
if global_position.distance_squared_to(next_dst) < 900.0:
vel_base = 160.0
var dir = (next_dst - position).normalized()
velocity = velocity.linear_interpolate(dir * vel_base, 0.3 * delta)
avoidance(delta)
flock(delta)
if velocity.length() < 3.0:
velocity += Vector2(randf() - 0.5, randf() - 0.5) * 6.0
attack()
velocity = move_and_slide(velocity)
if global_position.distance_squared_to(destination) < 25.0:
emit_signal("arrived", destination)
state = STATE_IDLE
arrived = true
STATE_DIALOGUE:
pass
STATE_CONTROL:
pass

45
proto1/npc_cheer.tscn Normal file
View File

@@ -0,0 +1,45 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://characters/TEMPLATE_improved.png" type="Texture" id=1]
[ext_resource path="res://npc.gd" type="Script" id=2]
[sub_resource type="CapsuleShape2D" id=1]
radius = 5.26428
height = 8.6982
[sub_resource type="CircleShape2D" id=2]
[node name="npc_cheer" type="KinematicBody2D"]
script = ExtResource( 2 )
[node name="back_hair" type="Polygon2D" parent="."]
color = Color( 0.0117647, 0.0117647, 0.0117647, 1 )
polygon = PoolVector2Array( -6.30672, -15.348, -6.30689, -23.9229, -3.39108, -27.8916, -0.880249, -27.0817, 0.0916901, -28.2156, 2.11655, -27.7296, 4.5464, -28.2966, 7.46221, -24.4899, 7.38122, -18.6582, 4.80413, -15.4175, 4.38748, -15.0008, 0.658653, -17.6053, -2.09517, -16.7954, -4.57064, -14.8619 )
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )
offset = Vector2( 0, -16 )
region_enabled = true
region_rect = Rect2( 24, 64, 24, 32 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( -0.250336, -9.01238 )
shape = SubResource( 1 )
[node name="top" type="Polygon2D" parent="."]
color = Color( 0.305882, 0.478431, 0.8, 1 )
polygon = PoolVector2Array( -2.87935, -16.3843, -3.71506, -13.3936, -3.37842, -12.0353, 2.92651, -12.0167, 3.49347, -13.7176, 2.82432, -16.2774 )
[node name="skirt" type="Polygon2D" parent="."]
color = Color( 0.305882, 0.478431, 0.8, 1 )
polygon = PoolVector2Array( -4.02008, -7.04458, -3.59231, -9.21911, 3.64423, -9.14781, 4.1433, -6.93764 )
[node name="front_hair" type="Polygon2D" parent="."]
color = Color( 0.0117647, 0.0117647, 0.0117647, 1 )
polygon = PoolVector2Array( -4.29287, -22.9867, -4.70953, -16.4591, -6.23727, -20.9729, -5.89006, -25.3478, -3.11235, -27.5005, -0.890175, -26.8755, 2.02642, -27.4311, 3.90138, -28.0561, 6.26244, -25.6256, 7.02631, -22.5006, 6.33188, -18.4729, 4.2486, -17.4313, 5.22079, -23.2645, 3.48473, -21.8756, 1.88754, -24.6534, 0.91534, -22.8478, 0.290356, -24.3061, -0.404076, -23.1256, -1.72349, -25.1395, -2.5568, -23.7506 )
[node name="capture" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="capture"]
position = Vector2( -0.043766, 3.80767 )
shape = SubResource( 2 )

64
proto1/npc_player.tscn Normal file
View File

@@ -0,0 +1,64 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://characters/TEMPLATE_improved.png" type="Texture" id=1]
[ext_resource path="res://npc.gd" type="Script" id=2]
[sub_resource type="CapsuleShape2D" id=1]
radius = 5.26428
height = 8.6982
[sub_resource type="CircleShape2D" id=2]
[node name="npc_player" type="KinematicBody2D"]
script = ExtResource( 2 )
[node name="back_hair" type="Polygon2D" parent="."]
color = Color( 0.313726, 0.054902, 0.054902, 1 )
polygon = PoolVector2Array( -5.09197, -18.9822, -6.54988, -21.2501, -6.46888, -24.6518, -4.12004, -27.8916, -2.01417, -27.2437, 0.982628, -27.6486, 3.0075, -28.1346, 5.27535, -25.9478, 6.0853, -22.546, 4.87038, -19.2252, 3.57446, -18.6582, 1.30661, -18.7392, -0.394279, -17.9293, -2.17616, -18.8202, -3.79606, -18.4152 )
__meta__ = {
"_edit_lock_": true
}
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )
offset = Vector2( 0, -16 )
region_enabled = true
region_rect = Rect2( 24, 64, 24, 32 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( -0.250336, -9.01238 )
shape = SubResource( 1 )
[node name="suit" type="Polygon2D" parent="."]
color = Color( 0.278431, 0.34902, 0.796078, 1 )
polygon = PoolVector2Array( -8.00949, -11.8635, -4.89114, -16.7281, 4.6718, -16.8113, 8.33066, -11.9466, 5.17073, -9.65985, 4.08971, -11.9051, 3.89845, -8.04792, 4.4654, -1.32536, 0.496666, -1.00138, 0.334671, -6.99499, -0.556267, -1.00138, -3.55307, -1.40636, -3.47208, -8.20992, -4.14274, -11.6972, -5.30692, -9.49353 )
__meta__ = {
"_edit_lock_": true
}
[node name="front_hair" type="Polygon2D" parent="."]
color = Color( 0.313726, 0.054902, 0.054902, 1 )
polygon = PoolVector2Array( -4.606, -24.6518, -5.17297, -22.546, -3.2291, -25.0568, -2.74313, -23.2749, -1.12323, -26.3527, 0.0916901, -23.2749, 1.06363, -25.9478, 1.30661, -23.4369, 2.03556, -23.9229, 2.44054, -26.2717, 3.33148, -23.0319, 3.97944, -22.708, 3.89845, -25.4618, 5.43734, -20.6021, 6.0853, -22.465, 4.78938, -26.9197, 1.63059, -28.4586, -0.0702972, -28.2966, -1.85218, -28.5396, -3.95805, -28.0536, -5.33496, -27.0817, -6.71187, -24.3279, -6.30689, -22.627 )
__meta__ = {
"_edit_lock_": true
}
[node name="boot1" type="Polygon2D" parent="."]
color = Color( 0.596078, 0.596078, 0.596078, 1 )
polygon = PoolVector2Array( -3.87705, -1.97332, -1.28522, -1.16337, -1.44721, -0.110443, -4.606, -0.110443, -4.84899, -1.40636 )
__meta__ = {
"_edit_lock_": true
}
[node name="boot2" type="Polygon2D" parent="."]
color = Color( 0.596078, 0.596078, 0.596078, 1 )
polygon = PoolVector2Array( 1.05451, -1.17793, 4.54707, -1.8016, 4.79653, -1.21951, 4.58864, -0.0553265, 1.17924, 0.0278301 )
__meta__ = {
"_edit_lock_": true
}
[node name="capture" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="capture"]
position = Vector2( 0.0831566, 1.62154 )
shape = SubResource( 2 )

View File

@@ -0,0 +1,55 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
_global_script_classes=[ {
"base": "Node",
"class": "BallGameAI",
"language": "GDScript",
"path": "res://ai/ball_game_ai.gd"
} ]
_global_script_class_icons={
"BallGameAI": ""
}
[application]
run/main_scene="res://ui/menu_root.tscn"
[autoload]
world="*res://autoloads/world.gd"
[input]
move_west={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
]
}
move_east={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
]
}
move_north={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
]
}
move_south={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
]
}
action1={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":69,"unicode":0,"echo":false,"script":null)
]
}

View File

@@ -0,0 +1,29 @@
extends Node2D
signal room_event
var bodies = []
func room_entered(body):
print("entered " + name)
if body.name == "master":
world.current_room = self
bodies.push_back(body)
func room_exited(body):
print("exited " + name)
if body.name == "master":
if world.current_room == self:
world.current_room = null
bodies.erase(body)
func room_event(event):
print("room: ", name, "room_event: ", event)
emit_signal("room_event", name, event)
func point_in_room(p: Vector2) -> bool:
var shape:CollisionShape2D = $Area2D/CollisionShape2D
return false
func _ready():
$Area2D.connect("body_entered", self, "room_entered")
$Area2D.connect("body_exited", self, "room_exited")
world.register_room_event(self, "action1", "room_event")
add_to_group("rooms")

33
proto1/ui/menu_root.gd Normal file
View File

@@ -0,0 +1,33 @@
extends Control
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func start_game():
var sc = load("res://main.tscn")
world.init_data()
get_tree().change_scene_to(sc)
func load_game():
pass
func display_options():
var sc = load("res://ui/options.tscn")
get_tree().change_scene_to(sc)
func display_development():
var sc = load("res://ui/development_menu.tscn")
get_tree().change_scene_to(sc)
func quit_game():
get_tree().quit()
func _ready():
$VBoxContainer/exit.connect("pressed", self, "quit_game")
$VBoxContainer/start.connect("pressed", self, "start_game")
$"VBoxContainer/load".connect("pressed", self, "load_game")
$VBoxContainer/options.connect("pressed", self, "display_options")
$VBoxContainer/development.connect("pressed", self, "display_development")
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass

78
proto1/ui/menu_root.tscn Normal file
View File

@@ -0,0 +1,78 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://ui/menu_root.gd" type="Script" id=1]
[ext_resource path="res://fonts/DroidSansFallback.ttf" type="DynamicFontData" id=2]
[sub_resource type="DynamicFont" id=1]
size = 32
font_data = ExtResource( 2 )
[node name="menu_root" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -512.0
margin_top = -125.5
margin_right = 512.0
margin_bottom = 125.5
__meta__ = {
"_edit_lock_": true
}
[node name="start" type="Button" parent="VBoxContainer"]
margin_right = 1024.0
margin_bottom = 49.0
custom_fonts/font = SubResource( 1 )
text = "Start"
__meta__ = {
"_edit_lock_": true
}
[node name="load" type="Button" parent="VBoxContainer"]
margin_top = 53.0
margin_right = 1024.0
margin_bottom = 102.0
custom_fonts/font = SubResource( 1 )
text = "Load"
__meta__ = {
"_edit_lock_": true
}
[node name="options" type="Button" parent="VBoxContainer"]
margin_top = 106.0
margin_right = 1024.0
margin_bottom = 155.0
custom_fonts/font = SubResource( 1 )
text = "Options"
__meta__ = {
"_edit_lock_": true
}
[node name="development" type="Button" parent="VBoxContainer"]
margin_top = 159.0
margin_right = 1024.0
margin_bottom = 208.0
custom_fonts/font = SubResource( 1 )
text = "Development"
__meta__ = {
"_edit_lock_": true
}
[node name="exit" type="Button" parent="VBoxContainer"]
margin_top = 212.0
margin_right = 1024.0
margin_bottom = 261.0
custom_fonts/font = SubResource( 1 )
text = "Exit"
__meta__ = {
"_edit_lock_": true
}