Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item types, activities carcass, qa tools #7

Merged
merged 29 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
cbdfca1
Removing empty entries from inventory simplified
TemirkhanN Aug 31, 2023
7b075f4
Perks are now applied to player stats respectively
TemirkhanN Aug 31, 2023
3c4c3aa
Implemented raw luberjack(woodcutting) activity
TemirkhanN Sep 1, 2023
ffb6ce7
More relevant timecalculation
TemirkhanN Sep 2, 2023
ff2401f
Reward model moved to player module
TemirkhanN Sep 2, 2023
bc8b261
Removed drop structure and replace with Item
TemirkhanN Sep 2, 2023
275410e
Player hunting calculation segregated. Now we can track kill count
TemirkhanN Sep 2, 2023
3eaec71
Static analyzer configured. Fixes according to analyzer
TemirkhanN Sep 3, 2023
3e23349
Codestyle analyzer configured
TemirkhanN Sep 3, 2023
f6da095
Added code analysis into CI
TemirkhanN Sep 3, 2023
722dc23
Fixed missing favicon complaints
TemirkhanN Sep 3, 2023
3230140
Temporarily adjusted codestyle
TemirkhanN Sep 3, 2023
6d4119f
Codesniffer applies to tests now
TemirkhanN Sep 3, 2023
9908b78
Implemented tests for activity handling. Stopped stamina regen for ch…
TemirkhanN Sep 3, 2023
994ddf5
Going for code coverage
TemirkhanN Sep 3, 2023
639903f
Checking another ci action
TemirkhanN Sep 3, 2023
a5ec319
Activities are generalized. They list is fixed though. Rewards should…
TemirkhanN Sep 4, 2023
3015bda
Introduced item types
TemirkhanN Sep 4, 2023
5198883
Added data caching to avoid duplicate read+parse
TemirkhanN Sep 5, 2023
e1d592a
Launcher is fully autonomous now
TemirkhanN Sep 5, 2023
84b3212
Fixed bug when player could go to dungeon while performing activity
TemirkhanN Sep 5, 2023
954b18c
A bit dimmer interface colors
TemirkhanN Sep 5, 2023
16e0825
Dimmer dropdown menus
TemirkhanN Sep 5, 2023
676d3d7
A bit contrast to read exhausted player stamina
TemirkhanN Sep 5, 2023
b49c5d7
Removed outdated todo
TemirkhanN Sep 5, 2023
f37b759
Merged status and info panel parts. Now there are info and actions pa…
TemirkhanN Sep 5, 2023
82b0b5a
Introduced player states
TemirkhanN Sep 5, 2023
737abda
Added perks details output
TemirkhanN Sep 5, 2023
f36fbae
Fixed player log reading
TemirkhanN Sep 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on: [ push ]

jobs:
tests:
qa:
runs-on: ubuntu-20.04
env:
DB_HOST: 127.0.0.1
Expand All @@ -22,16 +22,17 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- uses: nanasess/setup-php@master
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: xdebug
- name: install vendors
run: composer install --no-interaction
- name: install project
run: php install.php
# - name: codestyle
# run: ./vendor/bin/phpcs
# - name: static analyze
# run: ./vendor/bin/phpstan
- name: codestyle
run: ./vendor/bin/phpcs
- name: static analyze
run: ./vendor/bin/phpstan
- name: tests
run: ./vendor/bin/phpunit
run: php -dxdebug.mode=coverage ./vendor/bin/phpunit --coverage-text
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ log.txt
.phpunit.result.cache
var/**
!var/.gitkeep
.phpstan
.phpcs-cache
4 changes: 3 additions & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static function init(): void
}

/**
* @template T
* @template T of object
*
* @param class-string<T> $id
* @return T
Expand All @@ -60,6 +60,8 @@ public static function getService(string $id): object
if (self::$container === null) {
self::init();
}

// @phpstan-ignore-next-line
return self::$container->get($id);
}
}
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"autoload": {
"psr-4": {
"Game\\": "src/"
}
},
"files": [
"utils.php"
]
},
"autoload-dev": {
"psr-4": {
Expand All @@ -22,6 +25,8 @@
"symfony/http-foundation": "^6.3"
},
"require-dev": {
"phpunit/phpunit": "^10.3"
"phpunit/phpunit": "^10.3",
"phpstan/phpstan": "^1.10",
"free2er/coding-standard": "^1.1"
}
}
156 changes: 155 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions data/activity_option.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Lumberjack:
- id: 1
name: 'Hollow tree'
description: 'Hollow tree. Can be sold as fuel for a coin or two.'
complexity: 1
reward_exp: 5
reward_item_id: 6

- id: 2
name: 'Oak tree'
description: 'Strong tree. They say hogs love hanging around it.'
complexity: 3
reward_exp: 8
reward_item_id: 7
Farmer:
- id: 1
name: 'Hay field'
description: 'Dried grass that is usually used to feed cows.'
complexity: 1
reward_exp: 5
reward_item_id: 8
- id: 2
name: 'Potato field'
description: 'Grows underground. Does not need much and yields plenty of resource.'
complexity: 3
reward_exp: 8
reward_item_id: 9
25 changes: 25 additions & 0 deletions data/item.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,44 @@
id: 1
name: 'Gold Coins'
worth: 1
type: 'currency'
-
id: 2
name: Cheese
worth: 2
type: 'consumable'
-
id: 3
name: 'Short Sword'
worth: 18
type: 'weapon'
-
id: 4
name: 'Animal hide'
worth: 2
type: 'material'
-
id: 5
name: Leather
worth: 5
type: 'material'
-
id: 6
name: 'Firewood bundle'
worth: 1
type: 'material'
-
id: 7
name: Oak plank
worth: 2
type: 'material'
-
id: 8
name: 'Hay bale'
worth: 1
type: 'material'
-
id: 9
name: 'Potato'
worth: 2
type: 'consumable'
5 changes: 5 additions & 0 deletions data/item_effect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
name: 'Restore stamina'
type: 1
power: 5
-
item_id: 9
name: 'Restore stamina'
type: 1
power: 3
Loading