Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0008737 [DCSS] Patches feature N/A 2014-06-24 03:02 2014-07-02 04:56
Reporter Change View Status public  
Assigned To neil
Priority normal Resolution done  
Status resolved   Product Branch 0.15 ancient branch
Summary 0008737: Give clua all of a monsters unique spells
Description Lists all a monsters unique spells (listed in description already) in a string

makes https://github.com/jsravn/crawlrc/blob/master/init.txt#L835 [^] less tedious to write but function similarly/better.

the above becomes:
spells = m:spells()
if string.find(spells, "Paralyse") then
...
Additional Information
Tags No tags attached.
Attached Files ? file icon 0001-add-getting-monster-spells-to-clua-m-spells.patch [^] (2,442 bytes) 2014-06-24 03:02 [Show Content]
? file icon 0002-changed-clua-moninfo-spells-to-return-book-sets-stri.patch [^] (9,318 bytes) 2014-07-01 03:43 [Show Content]
txt file icon init.txt [^] (1,380 bytes) 2014-07-01 03:56 [Show Content]

- Relationships

-  Notes
(0026654)
neil (administrator)
2014-06-30 05:25
edited on: 2014-06-30 05:25

I think I would rather it return a table of strings, particularly since some spell names are substrings of others (Fireball and Ghostly Fireball, for example). It probably also makes sense to distinguish among the possible books, but I'm not sure what the best interface would be: maybe return multiple tables, or maybe a table of tables.

Finally, the common parts of this code and _monster_spells_description should be refactored into a separate function. Having that MST_GHOST check and unique_spells deduplication in both places is bad because someone will change the logic and update one but not the other.

(0026656)
Change (reporter)
2014-07-01 04:03

Moninfo:spells() returns table of tables similar to what is in describe
ie: {{"fireball", "banish"}, {"magic dart", "battlesphere"}}

put common code into suitable locations.

sample config too. Paralyse may be spelled differently to in game.
(0026661)
neil (administrator)
2014-07-02 04:56

In trunk (squashed into one commit: 0.15-a0-1830-g6f411d1), thanks!

- Issue History
Date Modified Username Field Change
2014-06-24 03:02 Change New Issue
2014-06-24 03:02 Change File Added: 0001-add-getting-monster-spells-to-clua-m-spells.patch
2014-06-30 05:25 neil Note Added: 0026654
2014-06-30 05:25 neil Note Edited: 0026654
2014-07-01 03:43 Change File Added: 0002-changed-clua-moninfo-spells-to-return-book-sets-stri.patch
2014-07-01 03:56 Change File Added: init.txt
2014-07-01 04:03 Change Note Added: 0026656
2014-07-01 14:16 neil Status new => assigned
2014-07-01 14:16 neil Assigned To => neil
2014-07-02 04:56 neil Note Added: 0026661
2014-07-02 04:56 neil Status assigned => resolved
2014-07-02 04:56 neil Fixed in Branch => 0.15 development branch
2014-07-02 04:56 neil Resolution open => done


Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker