It's Cow Game! Version 2.04!

This commit is contained in:
PajamaBee 2024-09-19 23:06:51 -05:00
commit a9e1ed9ddd
3148 changed files with 95332 additions and 0 deletions

27
Skills/Arson/Arson.gd Normal file
View file

@ -0,0 +1,27 @@
extends Skill
class_name Arson
func _init():
skillName = "Arson"
skillIcon = load("res://Skills/Arson/arsonIcon.png")
func get_ignition_chance(item:Item):
return get_ignition_chance_by_stats(item.get_flammability(), item.get_weight())
func get_ignition_chance_by_stats(flammability, weight):
var fireChance = flammability*0.5
var addedMassDifficulty = weight
fireChance -= addedMassDifficulty
if fireChance < -50:
fireChance = -50
fireChance += currentLevel*1.5
var penalty = floor(((50-flammability) - currentLevel)/10)
if penalty > 0:
for i in range(penalty):
fireChance = fireChance * 0.75
return fireChance

78
Skills/Arson/Fire.gd Normal file
View file

@ -0,0 +1,78 @@
extends Node2D
var rng = RandomNumberGenerator.new()
var itemBurning
var timeToBurn = 10
var endXP = 0
var xpPerTick = 0
var tickDuration = 0.8
var tickTimer = 0.8
func _ready():
$FireSprite.play("default")
var audioStartDelay = rng.randf_range(0, 2)
$AudioStreamPlayer2D.play(audioStartDelay)
func set_item_burning(item):
itemBurning = item
if item.weight < 0.5:
timeToBurn = 0.9
elif item.weight < 2:
timeToBurn = item.weight + 1
else:
timeToBurn = item.weight
if timeToBurn < 3:
timeToBurn = 3
if timeToBurn > 30:
timeToBurn = 30
endXP = 5
endXP += ((100-item.flammability) * 0.05) + (item.value * 0.7)
endXP += item.weight * 0.5
endXP = floor(endXP)
if Item.modifications.Sugared in item.itemModifications:
endXP -= (item.value * 0.5)
endXP = floor(endXP)
xpPerTick = 1
xpPerTick += int(endXP/40)
func _process(delta):
timeToBurn -= delta
if timeToBurn <= 0:
burn_out()
return
tickTimer -= delta
if tickTimer <= 0:
tickTimer = tickDuration
LevelManager.add_XP("arson", xpPerTick)
func burn_out():
var ashItem = null
if Item.modifications.Sugared in itemBurning.itemModifications:
ashItem = itemBurning.duplicate()
ashItem.itemModifications.erase(Item.modifications.Sugared)
ashItem.itemModifications.append(Item.modifications.Caramelized)
LevelManager.get_skill("appreciating").experience_item(itemBurning, "caramelized")
else:
ashItem = AshGenerator.generate_ash(itemBurning)
LevelManager.get_skill("appreciating").experience_item(ashItem, "burnedTo")
if ashItem.get_name(true) == "Popcorn":
AchievementManager.complete_achievement("Pop Pop Pop")
var groundItem = load("res://Objects/GroundItems/GroundItem.tscn").instantiate()
groundItem.set_item(ashItem)
get_parent().add_child(groundItem)
groundItem.global_position = global_position
LevelManager.add_XP("arson", endXP)
queue_free()

37
Skills/Arson/Fire.tscn Normal file
View file

@ -0,0 +1,37 @@
[gd_scene load_steps=7 format=3 uid="uid://byh444i8gvq8e"]
[ext_resource type="Texture2D" uid="uid://ba25fbsflxkft" path="res://Skills/Arson/FireAnim/Fire1.png" id="1_xh1v6"]
[ext_resource type="Texture2D" uid="uid://dufwp4sp2kyuv" path="res://Skills/Arson/FireAnim/Fire2.png" id="2_5gpom"]
[ext_resource type="Texture2D" uid="uid://b6a4awj22skbe" path="res://Skills/Arson/FireAnim/Fire3.png" id="3_7bbmj"]
[ext_resource type="Script" path="res://Skills/Arson/Fire.gd" id="4_gpc8w"]
[ext_resource type="AudioStream" uid="uid://dvhansvh7f4hx" path="res://Sounds/SFX/Fire/fire.mp3" id="5_0wdan"]
[sub_resource type="SpriteFrames" id="SpriteFrames_vomux"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("1_xh1v6")
}, {
"duration": 1.0,
"texture": ExtResource("2_5gpom")
}, {
"duration": 1.0,
"texture": ExtResource("3_7bbmj")
}],
"loop": true,
"name": &"default",
"speed": 8.0
}]
[node name="Fire" type="Node2D"]
script = ExtResource("4_gpc8w")
[node name="FireSprite" type="AnimatedSprite2D" parent="."]
position = Vector2(0, -42)
sprite_frames = SubResource("SpriteFrames_vomux")
frame_progress = 0.895414
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("5_0wdan")
max_distance = 600.0
bus = &"SFX"

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ba25fbsflxkft"
path="res://.godot/imported/Fire1.png-cb9bcdebc39cb72c99b01066a09d737d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Skills/Arson/FireAnim/Fire1.png"
dest_files=["res://.godot/imported/Fire1.png-cb9bcdebc39cb72c99b01066a09d737d.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dufwp4sp2kyuv"
path="res://.godot/imported/Fire2.png-9c7d8677f1191816f98a0d4807a783ab.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Skills/Arson/FireAnim/Fire2.png"
dest_files=["res://.godot/imported/Fire2.png-9c7d8677f1191816f98a0d4807a783ab.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b6a4awj22skbe"
path="res://.godot/imported/Fire3.png-564b02b6353aef1394417e2ab70883b8.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Skills/Arson/FireAnim/Fire3.png"
dest_files=["res://.godot/imported/Fire3.png-564b02b6353aef1394417e2ab70883b8.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

5
Skills/Arson/Smoke.gd Normal file
View file

@ -0,0 +1,5 @@
extends CPUParticles2D
func _process(delta):
if !emitting:
queue_free()

BIN
Skills/Arson/Smoke.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cfc72l832cx2j"
path="res://.godot/imported/Smoke.png-bec1bd4b03a441730b3e73fb513b5b63.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Skills/Arson/Smoke.png"
dest_files=["res://.godot/imported/Smoke.png-bec1bd4b03a441730b3e73fb513b5b63.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

25
Skills/Arson/Smoke.tscn Normal file
View file

@ -0,0 +1,25 @@
[gd_scene load_steps=4 format=3 uid="uid://uaw0ov1kraos"]
[ext_resource type="Texture2D" uid="uid://cfc72l832cx2j" path="res://Skills/Arson/Smoke.png" id="1_jbs76"]
[ext_resource type="Script" path="res://Skills/Arson/Smoke.gd" id="2_4ndct"]
[sub_resource type="Gradient" id="Gradient_6u5dr"]
offsets = PackedFloat32Array(0, 0.759336, 1)
colors = PackedColorArray(0, 0, 0, 1, 0.760784, 0.760784, 0.760784, 0, 1, 1, 1, 0)
[node name="Smoke" type="CPUParticles2D"]
emitting = false
amount = 6
one_shot = true
speed_scale = 0.6
explosiveness = 0.6
texture = ExtResource("1_jbs76")
emission_shape = 3
emission_rect_extents = Vector2(20, 1)
direction = Vector2(0, -1)
spread = 0.0
gravity = Vector2(0, 0)
initial_velocity_min = 27.4
initial_velocity_max = 41.1
color_ramp = SubResource("Gradient_6u5dr")
script = ExtResource("2_4ndct")

BIN
Skills/Arson/arsonIcon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ot8vppthxuwx"
path="res://.godot/imported/arsonIcon.png-5df1592202ed96d67a0edcfecdaf367d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Skills/Arson/arsonIcon.png"
dest_files=["res://.godot/imported/arsonIcon.png-5df1592202ed96d67a0edcfecdaf367d.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