-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
1,862 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[gd_resource type="Resource" script_class="ItemResource" load_steps=2 format=3 uid="uid://btc7drbnqg4ut"] | ||
|
||
[ext_resource type="Script" path="res://Scripts/Items/item.gd" id="1_v7fc7"] | ||
|
||
[resource] | ||
script = ExtResource("1_v7fc7") | ||
name = "Testing Arms" | ||
itemType = 1 | ||
equipLocation = 2 | ||
damage = 0 | ||
healthBonus = 3 | ||
defenseBonus = 3 | ||
magicBonus = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[gd_resource type="Resource" script_class="ItemResource" load_steps=2 format=3 uid="uid://dxg7ymgixgo1h"] | ||
|
||
[ext_resource type="Script" path="res://Scripts/Items/item.gd" id="1_b50x6"] | ||
|
||
[resource] | ||
script = ExtResource("1_b50x6") | ||
name = "Testing Chest" | ||
itemType = 1 | ||
equipLocation = 1 | ||
damage = 0 | ||
healthBonus = 10 | ||
defenseBonus = 10 | ||
magicBonus = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[gd_resource type="Resource" script_class="ItemResource" load_steps=2 format=3 uid="uid://u7ftew2fk1qq"] | ||
|
||
[ext_resource type="Script" path="res://Scripts/Items/item.gd" id="1_e0vbw"] | ||
|
||
[resource] | ||
script = ExtResource("1_e0vbw") | ||
name = "Testing Helmet" | ||
itemType = 1 | ||
equipLocation = 0 | ||
damage = 0 | ||
healthBonus = 5 | ||
defenseBonus = 5 | ||
magicBonus = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[gd_resource type="Resource" script_class="ItemResource" load_steps=2 format=3 uid="uid://cgd71ihob6xnu"] | ||
|
||
[ext_resource type="Script" path="res://Scripts/Items/item.gd" id="1_xpd8c"] | ||
|
||
[resource] | ||
script = ExtResource("1_xpd8c") | ||
name = "Testing Helmet2" | ||
itemType = 1 | ||
equipLocation = 0 | ||
damage = 0 | ||
healthBonus = 7 | ||
defenseBonus = 2 | ||
magicBonus = 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[gd_resource type="Resource" script_class="ItemResource" load_steps=2 format=3 uid="uid://b3n0yao3ojbfb"] | ||
|
||
[ext_resource type="Script" path="res://Scripts/Items/item.gd" id="1_pfysm"] | ||
|
||
[resource] | ||
script = ExtResource("1_pfysm") | ||
name = "Testing Legs" | ||
itemType = 1 | ||
equipLocation = 4 | ||
damage = 0 | ||
healthBonus = 2 | ||
defenseBonus = 2 | ||
magicBonus = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[gd_resource type="Resource" script_class="ItemResource" load_steps=2 format=3 uid="uid://dfric3nfcx62q"] | ||
|
||
[ext_resource type="Script" path="res://Scripts/Items/item.gd" id="1_nipv1"] | ||
|
||
[resource] | ||
script = ExtResource("1_nipv1") | ||
name = "Testing Shoes" | ||
itemType = 1 | ||
equipLocation = 5 | ||
damage = 0 | ||
healthBonus = 1 | ||
defenseBonus = 1 | ||
magicBonus = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[gd_resource type="Resource" script_class="ItemResource" load_steps=2 format=3 uid="uid://dro5g6dmh7e31"] | ||
|
||
[ext_resource type="Script" path="res://Scripts/Items/item.gd" id="1_4nbc1"] | ||
|
||
[resource] | ||
script = ExtResource("1_4nbc1") | ||
name = "Testing Sword" | ||
itemType = 1 | ||
equipLocation = 3 | ||
damage = 5 | ||
healthBonus = 0 | ||
defenseBonus = 0 | ||
magicBonus = 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
extends Node | ||
|
||
var items = Array() | ||
|
||
func _ready(): | ||
#open the resource script in directory | ||
var directory = DirAccess.open("res://Items") | ||
directory.list_dir_begin() | ||
|
||
var filename = directory.get_next() | ||
#add all the item resources to the item array | ||
while (filename): | ||
if not directory.current_is_dir(): | ||
items.append(load("res://Items/%s" % filename)) | ||
filename = directory.get_next() | ||
|
||
#loop through all items and return item if found | ||
func get_item(item_name): | ||
for i in items: | ||
if i.name == item_name: | ||
return i | ||
return null | ||
|
||
#loop through all items and return items of that type | ||
func get_item_type(item_type): | ||
var foundItems = Array() | ||
for i in items: | ||
if i.itemType == item_type: | ||
foundItems.append(i) | ||
return foundItems | ||
|
||
#returns array of items that belong that that equipment type | ||
func get_equip_type(equip_type): | ||
var foundItems = Array() | ||
for i in items: | ||
if i.equipLocation == equip_type: | ||
foundItems.append(i) | ||
return foundItems |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
extends Resource | ||
class_name ItemResource | ||
|
||
@export var name : String | ||
enum ItemType { CONSUMABLE, EQUIPMENT, GENERIC } | ||
enum EquipmentLocation { HEAD, CHEST, ARMS, HANDS, LEGS, FEET} | ||
@export var itemType : ItemType | ||
@export var equipLocation : EquipmentLocation | ||
@export var damage : int = 0 | ||
@export var healthBonus : int = 0 | ||
@export var defenseBonus : int = 0 | ||
@export var magicBonus : int = 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
extends Node2D | ||
|
||
var headPieces = Array() | ||
|
||
# Called when the node enters the scene tree for the first time. | ||
func _ready(): | ||
update_head_dropdown() | ||
#will be default at index 0 | ||
update_head_stats(0) | ||
|
||
|
||
|
||
#preform a get_equip_type call on data base that only returns type HEAD | ||
func update_head_dropdown(): | ||
headPieces = ItemDatabase.get_equip_type(0) | ||
#add each result to head optionMenue | ||
for i in headPieces: | ||
$HeadGearStats/HeadSelect.add_item(i.name) | ||
|
||
func update_head_stats(index): | ||
var text = "Health: %d" % headPieces[index].healthBonus | ||
$HeadGearStats/Health.set_text(text) | ||
text = "Damage Bonus: %d" % headPieces[index].damage | ||
$HeadGearStats/Damage.set_text(text) | ||
text = "Magic Bonus: %d" % headPieces[index].magicBonus | ||
$HeadGearStats/Magic.set_text(text) | ||
text = "Defense: %d" % headPieces[index].defenseBonus | ||
$HeadGearStats/Defense.set_text(text) | ||
|
||
#when a user selects an option | ||
func _on_head_select_item_selected(index): | ||
update_head_stats(index) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[gd_scene load_steps=3 format=3 uid="uid://f83w1j385c0o"] | ||
|
||
[ext_resource type="Script" path="res://character_scene.gd" id="1_emrmp"] | ||
[ext_resource type="Texture2D" uid="uid://cptyomp81xx1f" path="res://tempCharOutline.png" id="1_yabyc"] | ||
|
||
[node name="characterScene" type="Node2D"] | ||
position = Vector2(550, 350) | ||
scale = Vector2(0.5, 0.5) | ||
script = ExtResource("1_emrmp") | ||
|
||
[node name="BodyModel" type="Sprite2D" parent="."] | ||
texture = ExtResource("1_yabyc") | ||
|
||
[node name="HeadGearStats" type="GridContainer" parent="."] | ||
anchors_preset = 8 | ||
anchor_left = 0.5 | ||
anchor_top = 0.5 | ||
anchor_right = 0.5 | ||
anchor_bottom = 0.5 | ||
offset_left = -24.0 | ||
offset_top = -580.0 | ||
offset_right = 49.0 | ||
offset_bottom = -452.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
|
||
[node name="HeadSelect" type="OptionButton" parent="HeadGearStats"] | ||
layout_mode = 2 | ||
|
||
[node name="Health" type="Label" parent="HeadGearStats"] | ||
layout_mode = 2 | ||
text = "Health: " | ||
|
||
[node name="Damage" type="Label" parent="HeadGearStats"] | ||
layout_mode = 2 | ||
text = "Damage: " | ||
|
||
[node name="Magic" type="Label" parent="HeadGearStats"] | ||
layout_mode = 2 | ||
text = "Magic: " | ||
|
||
[node name="Defense" type="Label" parent="HeadGearStats"] | ||
layout_mode = 2 | ||
text = "Defense: " | ||
|
||
[connection signal="item_selected" from="HeadGearStats/HeadSelect" to="." method="_on_head_select_item_selected"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="CompressedTexture2D" | ||
uid="uid://cptyomp81xx1f" | ||
path="res://.godot/imported/tempCharOutline.png-da1471d592e63cb08ba099150ad056e4.ctex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://tempCharOutline.png" | ||
dest_files=["res://.godot/imported/tempCharOutline.png-da1471d592e63cb08ba099150ad056e4.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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import '@testing-library/jest-dom'; | ||
import BackButtonIcon from '../components/BackButtonIcon'; | ||
|
||
describe('BackButtonIcon', () => { | ||
it('renders the icon', () => { | ||
render( | ||
<BackButtonIcon | ||
groupIconWidth="50px" | ||
groupIconHeight="50px" | ||
groupIconPosition="absolute" | ||
groupIconTop="10px" | ||
groupIconRight="20px" | ||
groupIconBottom="30px" | ||
groupIconLeft="40px" | ||
groupIconMaxHeight="100%" | ||
/> | ||
); | ||
const icon = screen.getByRole('img'); | ||
expect(icon).toHaveAttribute('src', '/group.svg'); | ||
expect(icon).toHaveStyle({ | ||
width: '50px', | ||
height: '50px', | ||
position: 'absolute', | ||
top: '10px', | ||
right: '20px', | ||
bottom: '30px', | ||
left: '40px', | ||
maxHeight: '100%', | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.