v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "Mythical substance/script"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(Mythical healing generation script)
 
(Full information from Lua beta)
Line 1: Line 1:
 
<syntaxhighlight lang="lua" line>
 
<syntaxhighlight lang="lua" line>
 +
mythical_healing_adjectives={
 +
    "curious",
 +
    "weird",
 +
    "odd",
 +
    "strange",
 +
    "unusual",
 +
    "peculiar"
 +
}
 +
 +
mythical_healing_liquids={
 +
    "liquid",
 +
    "fluid",
 +
    "broth",
 +
    "juice",
 +
    "goo",
 +
    "liquor",
 +
    "solution"
 +
}
 +
 +
mythical_healing_alcohols={
 +
    liquor=true
 +
}
 +
 +
mythical_healing_globs={
 +
    "jelly",
 +
    "pulp",
 +
    "wax",
 +
    "jam",
 +
    "dough"
 +
}
 +
 
materials.mythical_healing.default=function()
 
materials.mythical_healing.default=function()
 
     local name_str = pick_random(mythical_healing_adjectives)
 
     local name_str = pick_random(mythical_healing_adjectives)
 
     local noun=""
 
     local noun=""
 +
    local lines={}
 
     if one_in(2) then
 
     if one_in(2) then
 
         noun=pick_random(mythical_healing_liquids)
 
         noun=pick_random(mythical_healing_liquids)

Revision as of 16:58, 26 February 2025

 1mythical_healing_adjectives={
 2    "curious",
 3    "weird",
 4    "odd",
 5    "strange",
 6    "unusual",
 7    "peculiar"
 8}
 9
10mythical_healing_liquids={
11    "liquid",
12    "fluid",
13    "broth",
14    "juice",
15    "goo",
16    "liquor",
17    "solution"
18}
19
20mythical_healing_alcohols={
21    liquor=true
22}
23
24mythical_healing_globs={
25    "jelly",
26    "pulp",
27    "wax",
28    "jam",
29    "dough"
30}
31
32materials.mythical_healing.default=function()
33    local name_str = pick_random(mythical_healing_adjectives)
34    local noun=""
35    local lines={}
36    if one_in(2) then
37        noun=pick_random(mythical_healing_liquids)
38        name_str=name_str.." "..noun
39        lines[#lines+1]="[STATE_NAME_ADJ:LIQUID:"..name_str.."]"
40        lines[#lines+1]="[STATE_NAME_ADJ:ALL_SOLID:frozen ]"..name_str.."]"
41        lines[#lines+1]="[MELTING_POINT:9900]"
42    else
43        noun=pick_random(mythical_healing_globs)
44        name_str=name_str.." "..noun
45        lines[#lines+1]="[STATE_NAME_ADJ:LIQUID:molten "..name_str.."]"
46        lines[#lines+1]="[STATE_NAME_ADJ:ALL_SOLID:]"..name_str.."]"
47        lines[#lines+1]="[MELTING_POINT:10200]"
48    end
49    lines[#lines+1]="[STATE_NAME_ADJ:GAS:boiling "..name_str.."]"
50    lines[#lines+1]="[BOILING_POINT:12000]"
51    populate_monotone_color_pattern()
52    local col_pat=pick_random(monotone_color_pattern)
53    if col_pat then
54        local col = world.descriptor.color[col_pat.color]
55        lines[#lines+1]="[STATE_COLOR:ALL:"..col.token.."]"
56        lines[#lines+1]="[DISPLAY_COLOR:"..col.col_f..":0:"..col.col_br
57    else
58        lines[#lines+1]="[DISPLAY_COLOR:1:0:1]"
59    end
60    lines[#lines+1]="[MATERIAL_VALUE:1]"
61    lines[#lines+1]="[SPEC_HEAT:4181]"
62    lines[#lines+1]="[IGNITE_POINT:NONE]"
63    lines[#lines+1]="[HEATDAM_POINT:NONE]"
64    lines[#lines+1]="[COLDDAM_POINT:NONE]"
65    lines[#lines+1]="[MAT_FIXED_TEMP:NONE]"
66    lines[#lines+1]="[MOLAR_MASS:1]"
67    
68    lines[#lines+1]="[EDIBLE_VERMIN]"
69    lines[#lines+1]="[EDIBLE_RAW]"
70    lines[#lines+1]="[EDIBLE_COOKED]"
71    lines[#lines+1]="[DO_NOT_CLEAN_GLOB]"
72    if mythical_healing_alcohols[noun] then -- i'm sure you can think of some alcoholic globs if you want
73        lines[#lines+1]="[ALCOHOL]"
74    end
75    lines[#lines+1]="[ENTERS_BLOOD]"
76    lines[#lines+1]="    [SYNDROME]"
77    lines[#lines+1]="        [SYN_NAME:"..name_str.." effect]"
78    lines[#lines+1]="        [SYN_AFFECTED_CLASS:GENERAL_POISON]"
79    lines[#lines+1]="        [SYN_INGESTED]"
80    --[[ all of this was in a for loop with individual creature effects listed out but (I *think*) the design purpose for that is fulfilled
81         by having it all out in Lua anyway, so I'm just going to hardcode it here and if users wanna mod it they can add their own function]]
82    lines[#lines+1]="        [CE_REGROW_PARTS:SEV:100:PROB:100:START:0:PEAK:0:END:12:ABRUPT:BP:BY_CATEGORY:ALL:ALL]"
83    lines[#lines+1]="        [CE_CLOSE_OPEN_WOUNDS:SEV:100:PROB:100:START:0:PEAK:0:END:12:ABRUPT:BP:BY_CATEGORY:ALL:ALL]"
84    lines[#lines+1]="        [CE_HEAL_TISSUES:SEV:100:PROB:100:START:0:PEAK:0:END:12:ABRUPT:BP:BY_CATEGORY:ALL:ALL]"
85    lines[#lines+1]="        [CE_HEAL_NERVES:SEV:100:PROB:100:START:0:PEAK:0:END:12:ABRUPT:BP:BY_CATEGORY:ALL:ALL]"
86    lines[#lines+1]="        [CE_STOP_BLEEDING:SEV:100:PROB:100:START:0:PEAK:0:END:12:ABRUPT:BP:BY_CATEGORY:ALL:ALL]"
87    lines[#lines+1]="        [CE_REDUCE_PAIN:SEV:100:PROB:100:START:0:PEAK:0:END:12:ABRUPT:BP:BY_CATEGORY:ALL:ALL]"
88    lines[#lines+1]="        [CE_REDUCE_DIZZINESS:SEV:100:PROB:100:START:0:PEAK:0:END:12:ABRUPT]"
89    lines[#lines+1]="        [CE_REDUCE_NAUSEA:SEV:100:PROB:100:START:0:PEAK:0:END:12:ABRUPT]"
90    lines[#lines+1]="        [CE_REDUCE_SWELLING:SEV:100:PROB:100:START:0:PEAK:0:END:12:ABRUPT:BP:BY_CATEGORY:ALL:ALL]"
91    lines[#lines+1]="        [CE_CURE_INFECTION:SEV:100:PROB:100:START:0:PEAK:0:END:12:ABRUPT:BP:BY_CATEGORY:ALL:ALL]"
92    lines[#lines+1]="        [CE_REDUCE_PARALYSIS:SEV:100:PROB:100:START:0:PEAK:0:END:12:ABRUPT:BP:BY_CATEGORY:ALL:ALL]"
93    lines[#lines+1]="        [CE_REDUCE_FEVER:SEV:100:PROB:100:START:0:PEAK:0:END:12:ABRUPT]"
94    return {mat=lines,weight=1}
95end