Tried to work on notes, but my brain is fried.

This commit is contained in:
Kayne Ruse 2025-04-04 18:01:52 +11:00
parent 58f8c27222
commit 75c2182f36
5 changed files with 51 additions and 17 deletions

View File

@ -18,7 +18,7 @@ Here's a few potential options, which absolutely will change over time:
* Mythic Odyssey * Mythic Odyssey
* Dreamlands/Cthulhu Horror/Gothic Horror (accessible only during the full/new moon) * Dreamlands/Cthulhu Horror/Gothic Horror (accessible only during the full/new moon)
* Stargates/Sliders * Stargates/Sliders
* Isekai Protag Syndrome * Isekai Protag Syndrome (mana-morph?)
* Gunslingers (Wild West) * Gunslingers (Wild West)
## Links And Resources ## Links And Resources

View File

@ -2,7 +2,37 @@
This file is a kind of scratch-pad for a multitude of ideas, that I can't implement yet. They'll be added to, refined or removed over time, so don't get too attached. This file is a kind of scratch-pad for a multitude of ideas, that I can't implement yet. They'll be added to, refined or removed over time, so don't get too attached.
TODO: Plan out each confirmed dimension. ## Entity Statistics
#TODO: brain no work, calc these later
Level = exp???
Base Stats, from 3 to 18: #TODO: are these needed?
STR, Strength
DEX, Dexterity
CON, Constitution
INT, Intelligence
WIS, Wisdom
CHA, Charisma
Derived Stats, will always change based on the base stats:
MaxHP:
CurHP:
Accuracy:
Evasion:
Damage:
Absorb:
To-hit, d20:
11 + weapon_accuracy - target_evasion
damage-dealt:
roll(weapon_damage) - target_absorb
## Dimension List
#TODO: Plan out each confirmed dimension.
## Concepts and Ideas ## Concepts and Ideas

View File

@ -302,7 +302,6 @@ class InventoryViewer(EventHandler):
options = ["Use", "Drop 1", "Drop All", "Back"] options = ["Use", "Drop 1", "Drop All", "Back"]
callback = lambda x: self.stack_selector_callback(x) callback = lambda x: self.stack_selector_callback(x)
#TODO: drop 1, drop all for stacks
self.engine.event_handler = OptionSelector( self.engine.event_handler = OptionSelector(
self.engine, self.engine,
self, self,

View File

@ -1,6 +1,8 @@
from __future__ import annotations from __future__ import annotations
from typing import Optional, TYPE_CHECKING from typing import Optional, TYPE_CHECKING
from utils import roll_dice
if TYPE_CHECKING: if TYPE_CHECKING:
from stats import Stats from stats import Stats
@ -71,6 +73,11 @@ class Unuseable(BaseUseable):
class PotionOfHealing(BaseUseable): class PotionOfHealing(BaseUseable):
#NetHack's healing potions, (B | U | C):
#Healing: 8d4 | 6d4 | 4d4. If the result is above MaxHP, MaxHP is incrased by 1 | 1 | 0.
#Extra Healing: 8d8 | 6d8 | 4d8. If the result is above MaxHP, MaxHP is incrased by 5 | 2 | 0.
#Full Healing: 400 | 400 | 400. If the result is above MaxHP, MaxHP is incrased by 8 | 4 | 0.
"""Restores 4d4 health when applied.""" """Restores 4d4 health when applied."""
__last_roll: int = -1 __last_roll: int = -1
@ -81,17 +88,3 @@ class PotionOfHealing(BaseUseable):
def get_used_msg(self, appearance: str) -> Optional[str]: def get_used_msg(self, appearance: str) -> Optional[str]:
return f"You restored {self.__last_roll} health." return f"You restored {self.__last_roll} health."
# NOTE: NetHack's version
# Healing: 8d4 | 6d4 | 4d4. If the result is above MaxHP, MaxHP is incrased by 1 | 1 | 0.
# Extra Healing: 8d8 | 6d8 | 4d8. If the result is above MaxHP, MaxHP is incrased by 5 | 2 | 0.
# Full Healing: 400 | 400 | 400. If the result is above MaxHP, MaxHP is incrased by 8 | 4 | 0.
#TODO: move this into a different file, 'utils.py'
import random
def roll_dice(number: int, sides: int) -> int:
total: int = 0
for i in range(number):
total += random.randint(1, sides)
return total

12
source/utils.py Normal file
View File

@ -0,0 +1,12 @@
import random
def roll_dice(number: int, sides: int) -> int:
"""
Rolls XdY, where X is `number` and Y is `sides`.
Returns the total value.
"""
total: int = 0
for i in range(number):
total += random.randint(1, sides)
return total