forked from irmen/Tale
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from neph1/update-v0.24.0
Update v0.24.0
- Loading branch information
Showing
13 changed files
with
211 additions
and
41 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,91 @@ | ||
{ | ||
"generic_weapons": [ | ||
{ | ||
"name": "Dagger", | ||
"weapon_type": "ONE_HANDED", | ||
"short_descr": "A steel dagger", | ||
"base_damage": 1, | ||
"weight": 0.5, | ||
"type": "Weapon" | ||
}, | ||
{ | ||
"name": "Club", | ||
"weapon_type": "ONE_HANDED", | ||
"short_descr": "A wooden club", | ||
"base_damage": 1, | ||
"weight": 1, | ||
"type": "Weapon" | ||
} | ||
], | ||
"fantasy_weapons": [ | ||
{ | ||
"name": "Sword", | ||
"weapon_type": "ONE_HANDED", | ||
"short_descr": "A plain sword", | ||
"base_damage": 2, | ||
"weight": 3, | ||
"value": 20, | ||
"type": "Weapon" | ||
}, | ||
{ | ||
"name": "Spear", | ||
"weapon_type": "TWO_HANDED", | ||
"short_descr": "A spear", | ||
"base_damage": 3, | ||
"weight": 4, | ||
"value": 10, | ||
"type": "Weapon" | ||
}, | ||
{ | ||
"name": "Crossbow", | ||
"weapon_type": "TWO_HANDED_RANGED", | ||
"short_descr": "A simple crossbow", | ||
"base_damage": 2, | ||
"weight": 5, | ||
"value": 50, | ||
"type": "Weapon" | ||
} | ||
], | ||
"modern_weapons": [ | ||
{ | ||
"name": "Rusty pipe", | ||
"weapon_type": "ONE_HANDED", | ||
"short_descr": "A left-over piece of plumbing", | ||
"base_damage": 1, | ||
"weight": 3, | ||
"value": 1 | ||
}, | ||
{ | ||
"name": "Semi-automatic pistol", | ||
"weapon_type": "ONE_HANDED_RANGED", | ||
"short_descr": "A pistol that has seen better days.", | ||
"base_damage": 2, | ||
"weight": 2, | ||
"value": 100 | ||
} | ||
], | ||
"fantasy_items": [ | ||
{ | ||
"name": "Potion of healing", | ||
"short_descr": "A potion of healing", | ||
"weight": 0.5, | ||
"value": 50, | ||
"effect": 10, | ||
"type": "Health" | ||
} | ||
], | ||
"generic_various": [ | ||
{ | ||
"name": "Note", | ||
"weight": 0.1, | ||
"type": "Note" | ||
}, | ||
{ | ||
"name": "Bread", | ||
"weight": 0.5, | ||
"short_descr": "A loaf of bread", | ||
"effect": 10, | ||
"type": "Food" | ||
} | ||
] | ||
} |
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
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
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,44 @@ | ||
|
||
|
||
from tale import parse_utils | ||
from tale.base import Weapon | ||
from tale.items import generic | ||
from tale.items.basic import Food, Health, Note | ||
from tale.weapon_type import WeaponType | ||
|
||
|
||
class TestGenericItems(): | ||
|
||
def test_load(self): | ||
assert(generic.items) | ||
|
||
def test_generic_items(self): | ||
assert(generic.generic_items) | ||
assert(generic.generic_items['fantasy']) | ||
assert(generic.generic_items['modern']) | ||
assert(generic.generic_items['postapoc']) | ||
assert(generic.generic_items['scifi']) | ||
assert(generic.generic_items['']) | ||
fantasy_weapon = generic.fantasy_weapons[0] | ||
assert(fantasy_weapon) | ||
assert(fantasy_weapon['name'] == 'Sword') | ||
items = parse_utils.load_items(generic.fantasy_weapons) | ||
assert(items) | ||
item = items['Sword'] | ||
assert(isinstance(item, Weapon)) | ||
assert(item.type == WeaponType.ONE_HANDED) | ||
|
||
def test_various(self): | ||
items = parse_utils.load_items(generic.generic_various) | ||
food = items['Bread'] | ||
assert(isinstance(food, Food)) | ||
assert(food.affect_fullness == 10) | ||
note = items['Note'] | ||
assert(isinstance(note, Note)) | ||
|
||
def test_health(self): | ||
items = parse_utils.load_items(generic.fantasy_items) | ||
assert(items) | ||
item = items['Potion of healing'] | ||
assert(isinstance(item, Health)) | ||
assert(item.healing_effect == 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
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