It's Cow Game! Version 2.04!
This commit is contained in:
commit
a9e1ed9ddd
3148 changed files with 95332 additions and 0 deletions
17
Objects/SkillSpecific/Swimming/BridgeSwimmingZone.gd
Normal file
17
Objects/SkillSpecific/Swimming/BridgeSwimmingZone.gd
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
extends SwimmingZone
|
||||
|
||||
@export var bridge:Node2D
|
||||
|
||||
func _process(delta):
|
||||
super._process(delta)
|
||||
|
||||
if bridge != null:
|
||||
if bridge.complete:
|
||||
$SwimmingArea.monitoring = false
|
||||
$SwimmingArea.monitorable = false
|
||||
else:
|
||||
$SwimmingArea.monitoring = true
|
||||
$SwimmingArea.monitorable = true
|
||||
else:
|
||||
$SwimmingArea.monitoring = true
|
||||
$SwimmingArea.monitorable = true
|
||||
17
Objects/SkillSpecific/Swimming/NoSwimBlocker.gd
Normal file
17
Objects/SkillSpecific/Swimming/NoSwimBlocker.gd
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
extends StaticBody2D
|
||||
|
||||
class_name NoSwimBlocker
|
||||
|
||||
var messageDelay = 0
|
||||
|
||||
func _process(delta):
|
||||
if messageDelay > 0:
|
||||
messageDelay -= delta
|
||||
|
||||
func cow_collided():
|
||||
if messageDelay <= 0:
|
||||
var messageString = "You need level " + str(get_parent().swimmingLevelReq) + " swimming to swim here"
|
||||
MessageManager.addMessage(messageString,
|
||||
null, "System", Color.BLUE, true, false)
|
||||
|
||||
messageDelay = 1.5
|
||||
45
Objects/SkillSpecific/Swimming/SwimmingZone.gd
Normal file
45
Objects/SkillSpecific/Swimming/SwimmingZone.gd
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
extends Node2D
|
||||
|
||||
class_name SwimmingZone
|
||||
|
||||
@export var liquidColor:Color
|
||||
@export var swimmingLevelReq:int
|
||||
@export var swimmingXp:int
|
||||
@export var swimmingSpeed:int = 160
|
||||
@export var viscosity:int = 50
|
||||
|
||||
func _ready():
|
||||
%NoSwimShape.polygon = $SwimmingArea.get_child(0).polygon
|
||||
$NoSwimBlocker.position = $SwimmingArea.position
|
||||
|
||||
func _process(delta):
|
||||
if LevelManager.skill_check("swimming", swimmingLevelReq):
|
||||
%NoSwimShape.disabled = true
|
||||
else:
|
||||
%NoSwimShape.disabled = false
|
||||
|
||||
func add_swam_location():
|
||||
var locationName = LocationManager.currentLocationName
|
||||
SaveManager.save_to_section("SwamAt", str(locationName), true)
|
||||
var config = SaveManager.get_save_config()
|
||||
var swamLocations = config.get_section_keys("SwamAt")
|
||||
if swamLocations.size() >= 5:
|
||||
AchievementManager.complete_achievement("Duathlon")
|
||||
|
||||
func _on_swimming_area_area_entered(area):
|
||||
if area.get_parent() is Cow:
|
||||
if LevelManager.skill_check("swimming", swimmingLevelReq):
|
||||
area.get_parent().add_swimming_area(self)
|
||||
add_swam_location()
|
||||
elif area.get_parent() is GroundItem:
|
||||
area.get_parent().interactingTerrains.append(self)
|
||||
elif area.get_parent() is Ball and area.name == "WaterZone":
|
||||
area.get_parent().add_swimming_area(self)
|
||||
|
||||
func _on_swimming_area_area_exited(area):
|
||||
if area.get_parent() is Cow:
|
||||
area.get_parent().remove_swimming_area(self)
|
||||
elif area.get_parent() is GroundItem:
|
||||
area.get_parent().interactingTerrains.erase(self)
|
||||
elif area.get_parent() is Ball and area.name == "WaterZone":
|
||||
area.get_parent().remove_swimming_area(self)
|
||||
20
Objects/SkillSpecific/Swimming/SwimmingZone.tscn
Normal file
20
Objects/SkillSpecific/Swimming/SwimmingZone.tscn
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://dss4ph0tkc0xc"]
|
||||
|
||||
[ext_resource type="Script" path="res://Objects/SkillSpecific/Swimming/SwimmingZone.gd" id="1_a05yf"]
|
||||
[ext_resource type="Script" path="res://Objects/SkillSpecific/Swimming/NoSwimBlocker.gd" id="2_5bfw5"]
|
||||
|
||||
[node name="SwimmingZone" type="Node2D"]
|
||||
script = ExtResource("1_a05yf")
|
||||
|
||||
[node name="SwimmingArea" type="Area2D" parent="."]
|
||||
|
||||
[node name="NoSwimBlocker" type="StaticBody2D" parent="."]
|
||||
collision_layer = 4
|
||||
collision_mask = 4
|
||||
script = ExtResource("2_5bfw5")
|
||||
|
||||
[node name="NoSwimShape" type="CollisionPolygon2D" parent="NoSwimBlocker"]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[connection signal="area_entered" from="SwimmingArea" to="." method="_on_swimming_area_area_entered"]
|
||||
[connection signal="area_exited" from="SwimmingArea" to="." method="_on_swimming_area_area_exited"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue