New Content - Implemented Add Phylum to monster data

Bale

Minion
Currently there are only 2 items (Stomping Boots and Vampire Fangs) that make use of monster phylum, but since there are now two uses for this information, I suspect that a third is inevitable. Jick tends to use content vectors when he creates them and this one is both interesting and amusing. We'd be getting ahead of the curve by adding this feature now, rather than later when it becomes important.

List of 22 Phylum: http://kol.coldfront.net/thekolwiki/index.php/Phylum.
Unsquishable monsters may be an unclassified 23rd Phylum. I'd suggest listing them as phylum "uncategorized" until we have a better name for them so that only brand new monsters will lack a phylum.

Obviously the biggest PIA is adding phylum information to every monster in our database. Each of the 22 phyla has a category page on the wiki listing every monster of that phylum. Could someone write a script to scrape the 22 pages on the wiki and add that phylum to the monster data?
 
Last edited:

zarqon

Well-known member
A further possibility would be making it one of mafia's typed constants, so that the proxy record field would be of type $phylum. It may also be handy later to be able to foreach over phyla.

I'm a fan of proxy records over ASH functions, in case you couldn't tell.
 

Bale

Minion
I can tell. Personally I can go either way, function or proxy field. It seems like a bigger deal to create a whole new datatype for phylum instead of using strings, but I suppose it might solve problems that do not yet exist.

So should $phylum's plural datatype be $phyla instead of $plylums? Ah, irregular plurals are fun!
 

Veracity

Developer
Staff member
So should $phylum's plural datatype be $phyla instead of $plylums? Ah, irregular plurals are fun!
Latin singular neuter: phylum
Latin plural neuter: phyla

"ph" is weird for Latin, but there is nothing "irregular" about "um" -> "a". That is completely regular for neuter nouns.
 

Bale

Minion
It is irregular for an English noun. I'm aware that the reason for the irregularity is that the word is borrowed from Latin. It still tickles my fancy as an irregular English plural despite being a perfectly normal Latin plural.
 

zarqon

Well-known member
And if we were talking about multiple groups of phyla we could use 'phylae'. :p

I often get in interesting discussions about plurals with my ESL students. Oddly, 'fishes' is one of the hardest to explain.

EDIT cf. below: 'fishes' is used when multiple species of fish are involved, as opposed to 'fish' when all of the fish are the same species. However, if it's meat, then it's an uncountable noun and is therefore always 'fish'.
 
Last edited:

Bale

Minion
How can you explain fishes? It doesn't make any sense and it is optional.

Wait! Nevermind. Let's not continue to drag this thread off topic.
 

Fluxxdog

Active member
Well, honestly, since $class => $classes, the standard would at least seem to be to use the proper plural which would be $phylum => $phyla
 

lostcalpolydude

Developer
Staff member
How should it go in the data file? I started adding these by hand and adding a column before the list of items that a monster drops seemed like it would be the easiest to parse (and create, since I'm using a spreadsheet for this...). However, it now occurs to me that "P: beast" added to the second column might be better. I don't really know how the code works to know what's better for parsing. Taking the data file where it's in the third column and merging it into the second column with a script shouldn't be too hard for someone that knows how to do that, right?
 

slyz

Developer
Putting it as "P:Beast" along with the other monster info in the second column would be better. This way it could be processed along with the rest in MonsterData.registerMonster().
 

lostcalpolydude

Developer
Staff member
Here is monsters.txt with phylum data added. I didn't worry about adding uncharacterized stuff yet.
 

Attachments

  • monsters2.txt
    115 KB · Views: 258
Last edited:

Rinn

Developer
You should probably put a space after the P: to make it consistent with the format of the other monster info.
 

lostcalpolydude

Developer
Staff member
Change made in my previous post. Also, somehow there were a bunch of extra " around things, so I went through and fixed that.

It looks strange not having effects at the end of that list, but looking at registerMonster() that shouldn't cause any problems.
 

slyz

Developer
Code:
# httP: //forums.kingdomofloathing.com/viewtopic.php?t=39973&start=0

I see I'm not the only one who did a case-insensitive search and replace for "P:" -> "P: " :)
 

slyz

Developer
r9868 adds lost's changes to monsters.txt (I'm sorry, I just realized I forgot to thank you in the commit :( )

I also added the $phylum type, and the following ASH functions:

phylum to_phylum( string )
phylum monster_phylum()
phylum monster_phylum( monster )

The possible values are:
Code:
> ashq foreach p in $phylums[] print(p);

beast
bug
constellation
crimbo
demihuman
demon
elemental
fish
goblin
hippy
hobo
humanoid
horror
mer-kin
object
orc
penguin
pirate
plant
slime
strange
undead
(notice I changed "weird" to "strange". I added it in the source and it took less time to change it in monsters.txt)

Example:
Code:
> ashq if ( $monster[ blooper ].monster_phylum() == $phylum[ beast ] ) print( "it's a beast" );

it's a beast

Upcoming: adding proxy values for $monster, including phylum, and decorating the Relay Browser with the monster's phylum.

EDIT: I should probably also add some sort of phylum_to_paste() function.
EDIT2: I'm sorry, but it's way simpler to have $phylums as the plural typed constant.
 
Last edited:

slyz

Developer
r9869 allows the use of $phylae[]

It wasn't that complicated to take into account.
Code:
> ashq foreach p in $phylae[] print( p );

beast
bug
constellation
crimbo
demihuman
demon
elemental
fish
goblin
hippy
hobo
humanoid
horror
mer-kin
object
orc
penguin
pirate
plant
slime
strange
undead
 

slyz

Developer
Here is a patch for a
Code:
item to_paste( phylum )
function.

It relies on the phylums in MonsterDatabase.java being in the same order as the pastes (which are classified by item number) in ItemPool.java.

The problem is that this implementation won't survive the addition of a new kind of phylum/paste.
 

Attachments

  • to_paste.patch
    3.8 KB · Views: 21

slyz

Developer
r9870 adds the monster's phylum in the relay browser.
Code:
You're fighting [B]The Axe Wound[/B]
HP: 160, Atk: 173, Def: 156, Type: constellation
 

Bale

Minion
Time from initial proposal to full implementation: 22 hours. Not bad.

Assuming that you count it as fully implemented without the paste() function which really wasn't implied by the proposal. I figured that a paste() function would be a part of any scripting project that used this for stomping.
 
Top