aboutsummaryrefslogtreecommitdiff
path: root/lawsuit
diff options
context:
space:
mode:
Diffstat (limited to 'lawsuit')
-rw-r--r--lawsuit/guilty.gd3
-rw-r--r--lawsuit/innocent.gd4
-rw-r--r--lawsuit/lawsuit.gd46
-rw-r--r--lawsuit/lawsuit.tscn76
-rw-r--r--lawsuit/miles.gd9
-rw-r--r--lawsuit/miles.tscn20
-rw-r--r--lawsuit/objection.tscn10
-rw-r--r--lawsuit/wright.gd14
-rw-r--r--lawsuit/wright.tscn20
9 files changed, 201 insertions, 1 deletions
diff --git a/lawsuit/guilty.gd b/lawsuit/guilty.gd
new file mode 100644
index 0000000..2b38524
--- /dev/null
+++ b/lawsuit/guilty.gd
@@ -0,0 +1,3 @@
+extends "res://lib/clickable_area.gd"
+func _click():
+ get_parent().plead_guilty()
diff --git a/lawsuit/innocent.gd b/lawsuit/innocent.gd
new file mode 100644
index 0000000..db8b27f
--- /dev/null
+++ b/lawsuit/innocent.gd
@@ -0,0 +1,4 @@
+extends ClickableArea
+
+func _click():
+ get_parent().plead_innocent()
diff --git a/lawsuit/lawsuit.gd b/lawsuit/lawsuit.gd
new file mode 100644
index 0000000..3cf596b
--- /dev/null
+++ b/lawsuit/lawsuit.gd
@@ -0,0 +1,46 @@
+extends Node2D
+
+onready var miles = preload("res://lawsuit/miles.tscn")
+onready var wright = preload("res://lawsuit/wright.tscn")
+
+func get_cost():
+ var x = 1
+ for value in SaveState.upgrades.values():
+ x *= value
+ for value in SaveState.buildings.values():
+ x *= value
+ return x
+
+func _ready():
+ $CanvasModulate/case.text = "you are being sued for:\n"+str(get_cost())
+
+func lose():
+ SaveState.lose_bitcoin(get_cost() * 2)
+ exit()
+
+func win():
+ exit()
+
+func plead_guilty():
+ SaveState.lose_bitcoin(get_cost())
+ exit()
+
+func plead_innocent():
+ $Area2D.queue_free()
+ $Area2D2.queue_free()
+ for i in range(SaveState.buildings['lawyer']):
+ var w = wright.instance()
+ w.position = Vector2(0, rand_range(0, 640))
+ add_child(w)
+ for i in range(rand_range(1, int(ceil(SaveState.buildings['dev']))+1)):
+ var m = miles.instance()
+ m.position = Vector2(1024, rand_range(0, 640))
+ add_child(m)
+
+func exit():
+ queue_free()
+ SaveState.riot_cooldown = 20
+ for child in get_parent().get_children():
+ if child is CanvasItem:
+ child.show()
+ child.pause_mode = PAUSE_MODE_INHERIT
diff --git a/lawsuit/lawsuit.tscn b/lawsuit/lawsuit.tscn
index b171e8d..43ee71d 100644
--- a/lawsuit/lawsuit.tscn
+++ b/lawsuit/lawsuit.tscn
@@ -1,3 +1,77 @@
-[gd_scene format=2]
+[gd_scene load_steps=8 format=2]
+
+[ext_resource path="res://lawsuit/guilty.gd" type="Script" id=1]
+[ext_resource path="res://lawsuit/lawsuit.gd" type="Script" id=2]
+[ext_resource path="res://lawsuit/innocent.gd" type="Script" id=3]
+[ext_resource path="res://tutorial/popup.tscn" type="PackedScene" id=4]
+[ext_resource path="res://tutorial/lawsuit.gd" type="Script" id=5]
+
+[sub_resource type="RectangleShape2D" id=1]
+extents = Vector2( 110.744, 38.7256 )
+
+[sub_resource type="RectangleShape2D" id=2]
+extents = Vector2( 76.9935, 33.0056 )
[node name="Node2D" type="Node2D"]
+script = ExtResource( 2 )
+
+[node name="Area2D" type="Area2D" parent="."]
+script = ExtResource( 3 )
+
+[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
+position = Vector2( 251.68, 215.419 )
+shape = SubResource( 1 )
+
+[node name="Label" type="Label" parent="Area2D"]
+margin_left = 157.568
+margin_top = 181.311
+margin_right = 213.568
+margin_bottom = 195.311
+rect_scale = Vector2( 3.2479, 4.51041 )
+text = "innocent"
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="Area2D2" type="Area2D" parent="."]
+script = ExtResource( 1 )
+
+[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D2"]
+position = Vector2( 683.056, 192.431 )
+shape = SubResource( 2 )
+
+[node name="Label2" type="Label" parent="Area2D2"]
+margin_left = 617.321
+margin_top = 172.677
+margin_right = 657.321
+margin_bottom = 186.677
+rect_scale = Vector2( 3.62789, 2.98543 )
+text = "guilty"
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="CanvasModulate" type="CanvasModulate" parent="."]
+
+[node name="case" type="Label" parent="CanvasModulate"]
+margin_left = 340.82
+margin_top = 4.0
+margin_right = 456.82
+margin_bottom = 37.0
+rect_scale = Vector2( 3.29888, 3.00277 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="lawsuit" parent="CanvasModulate" instance=ExtResource( 4 )]
+margin_left = 397.158
+margin_top = 343.196
+margin_right = 644.158
+margin_bottom = 374.196
+text = "You are being sued. If you plead guilty,
+you will have to pay a fine.
+If you plead guilty, you will pay the fine.
+If you plead innnocent, your lawyers will fight for you,
+and you will have a chance to win or lose and pay more or less"
+script = ExtResource( 5 )
+identifier = "lawsuit"
diff --git a/lawsuit/miles.gd b/lawsuit/miles.gd
new file mode 100644
index 0000000..7ea8213
--- /dev/null
+++ b/lawsuit/miles.gd
@@ -0,0 +1,9 @@
+extends Node2D
+onready var speed = rand_range(80, 200)
+func _physics_process(delta):
+ position += Vector2(-speed, 0) * delta
+ if position.x < 0:
+ get_parent().lose()
+
+func _on_Area2D_area_shape_entered(area_id, area, area_shape, self_shape):
+ queue_free()
diff --git a/lawsuit/miles.tscn b/lawsuit/miles.tscn
new file mode 100644
index 0000000..1d8175e
--- /dev/null
+++ b/lawsuit/miles.tscn
@@ -0,0 +1,20 @@
+[gd_scene load_steps=4 format=2]
+
+[ext_resource path="res://assets/Angry lawyer 2.png" type="Texture" id=1]
+[ext_resource path="res://lawsuit/miles.gd" type="Script" id=2]
+
+[sub_resource type="RectangleShape2D" id=1]
+extents = Vector2( 94.2158, 121.426 )
+
+[node name="Node2D" type="Node2D"]
+script = ExtResource( 2 )
+
+[node name="Sprite" type="Sprite" parent="."]
+scale = Vector2( -1, 1 )
+texture = ExtResource( 1 )
+
+[node name="Area2D" type="Area2D" parent="."]
+
+[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
+shape = SubResource( 1 )
+[connection signal="area_shape_entered" from="Area2D" to="." method="_on_Area2D_area_shape_entered"]
diff --git a/lawsuit/objection.tscn b/lawsuit/objection.tscn
new file mode 100644
index 0000000..c262168
--- /dev/null
+++ b/lawsuit/objection.tscn
@@ -0,0 +1,10 @@
+[gd_scene load_steps=2 format=2]
+
+[ext_resource path="res://assets/OBJECTION.png" type="Texture" id=1]
+
+[node name="Node2D" type="Node2D"]
+position = Vector2( 1.22777, -1.52588e-05 )
+
+[node name="Sprite" type="Sprite" parent="."]
+position = Vector2( 158.378, -18.416 )
+texture = ExtResource( 1 )
diff --git a/lawsuit/wright.gd b/lawsuit/wright.gd
new file mode 100644
index 0000000..42a53ce
--- /dev/null
+++ b/lawsuit/wright.gd
@@ -0,0 +1,14 @@
+extends Node2D
+var blueprint = preload("res://lawsuit/objection.tscn")
+onready var speed = rand_range(80, 200)
+func _physics_process(delta):
+ position += Vector2(speed, 0) * delta
+ if position.x > 1024:
+ get_parent().win()
+
+
+func _on_Area2D_area_shape_entered(area_id, area, area_shape, self_shape):
+ queue_free()
+ var objection = blueprint.instance()
+ objection.position = position
+ get_parent().add_child(objection)
diff --git a/lawsuit/wright.tscn b/lawsuit/wright.tscn
new file mode 100644
index 0000000..f753cb6
--- /dev/null
+++ b/lawsuit/wright.tscn
@@ -0,0 +1,20 @@
+[gd_scene load_steps=4 format=2]
+
+[ext_resource path="res://assets/AngryAnwalt.png" type="Texture" id=1]
+[ext_resource path="res://lawsuit/wright.gd" type="Script" id=2]
+
+[sub_resource type="RectangleShape2D" id=1]
+extents = Vector2( 95.4435, 114.059 )
+
+[node name="Node2D" type="Node2D"]
+script = ExtResource( 2 )
+
+[node name="Sprite" type="Sprite" parent="."]
+texture = ExtResource( 1 )
+
+[node name="Area2D" type="Area2D" parent="."]
+
+[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
+position = Vector2( -3.6832, 0 )
+shape = SubResource( 1 )
+[connection signal="area_shape_entered" from="Area2D" to="." method="_on_Area2D_area_shape_entered"]