duysqubix / scrolls

elder scrolls mud based on UESRPG3e
3 stars 2 forks source link

Disease/help strings #53

Closed j3b4 closed 3 years ago

j3b4 commented 3 years ago

Edited a copy of help_entries/races.py to create help_entries/diseases.py. Then I started adding the doc strings to the empty classes in world/diseases.py . No idea what will go on behind the scene.

I'm using UESRPG text for the disease descriptions but have taken the liberty to make the mechanics more vague so as not to give players inaccurate or distracting information. I could change this to just put in the numbers from the RPG verbatim ie. -50 Magicka ; and roll d100 after one week.

Let me know what you think.

duysqubix commented 3 years ago

I will check it out in the morning to see if it updates fine. From the looks of it, it should work as expected.

duysqubix commented 3 years ago

Immediately what I can see though is that you will have to add a module level variable of

ALL_DISEASES

That is a list of the class names. Such as

ALL_DISEASES = [Ataxia, Brainrot,...]

So that the wrapper can iterate through the static classes and access the __doc__ string

j3b4 commented 3 years ago

Is something like this okay:

class BoneBreak(Disease):
    """
    """
    __obj_name__ = "bone break fever"
    pass

__obj_name__ is what is used in world/races.py and world/birthsigns.py and in help_entries both races and birthsigns use string = ", ".join([x.name.capitalize() ...

Just wondering if I should follow your example in the comment above or in your code.

duysqubix commented 3 years ago

Oh yea if I do that then go for it. Help entries is one of the first things I did quite a while ago. Memory is a bit rusty.

duysqubix commented 3 years ago

Finally at a computer @j3b4 I see that I haven't even touched Diseases yet. You can continue using the same pattern like I do for Races and Conditions by using

__obj_name__ if you plan on using the code of

diseases = [x.name.capitalize() for x in ALL_DISEASES]

Then you will need to have the following done for the parent class of Disease something like this:


class Disease:
    __obj_name__ = ""

   @property
   def name(self):
      return self.__obj_name__

class BrainRot(Disease):
   __obj_name__ = "brain_rot" #try to refrain from using spaces, replace with _

class Fever(Disease):
   __obj_name__ = "fever"

ALL_DISEASES = [BrainRot(), Fever()]
j3b4 commented 3 years ago

Okay this completes the docstrings for diseases. The main descriptions are verbatim (except for typos I noticed in the original) UESRPG 3e (version 3) but "symptoms" and "progression" have been edited to avoid describing mechanics that may or may not be reflected in the MUD code.

duysqubix commented 3 years ago

Ha. The coronavirus was a nice touch.

j3b4 commented 3 years ago

Added the name method to Disease() and replaced spaces with underscores in names.

duysqubix commented 3 years ago

Very nice. I'll checkout latest to see if it successfully updates help entries on diseases.

duysqubix commented 3 years ago

So I have made some minor changes to the PR to have it work properly.

I would recommend removing the sections in the diseases it messes up the formatting.