(Shotgun) DSS Chargen Code

Submitted by Reaver on Sat, 2009-12-05 06:03

Some more scraps I found. I ended up recoding some of the chargen commands to work with my systems. This might give some indication of the approach I used to reprogram the system, and make it easier to reproduce things if people are interested.

@create DSS Chargen Commands
@link DSS Chargen Commands = #0
@set DSS Chargen Commands = WIZARD
&CMD_DESELECT DSS Chargen Commands=$+deselect *:@pemit %#=[ifelse([ulocal(v(DB_Database)/FN_HasSkills,%#)],switch([setq(0,secure(%0))][setq(1,grab(get(v(DB_Database)/List_Feats),[%q0]*,|))][setq(2,grab(get(v(DB_Database)/List_Languages),[%q0]*))][t(words(%q1))][t(words(%q2))],1*,[setq(4,extract(%q1,1,1))][ifelse(extract(%q1,2,1),ifelse(match(get(%#/DSS_Feats),%q4),ifelse(gte(get(%#/DSS_XP),[setr(3,mul(-1,extract(%q1,3,1)))]),You no longer have the [ansi(y,edit(%q4,_,%b))] feat.[set(%#,DSS_Feats:[setdiff(get(%#/DSS_Feats),%q4)])][set(%#,DSS_XP:[sub(get(%#/DSS_XP),%q3)])],You are short [ansi(y,sub(get(%#/DSS_XP),%q3))] experience points.),[ansi(rh,-)] You dont have the [ansi(y,edit(%q4,_,%b))] feat.),[ansi(rh,-)] You may not deselect the [ansi(y,edit(%q4,_,%b))] feat. Only staff may remove that feat via +delfeat.)],01,[ifelse(match(get(%#/DSS_Languages),%q2),ifelse(gte(get(%#/DSS_XP),[setr(3,mul(-1,get(v(DB_Database)/Cost_Lang)))]),You no longer understand the [ansi(y,edit(%q2,_,%b))] language.[set(%#,DSS_Languages:[setdiff(get(%#/DSS_Languages),%q2)])][set(%#,DSS_XP:[sub(get(%#/DSS_XP),%q3)])],You are short [ansi(y,sub(get(%#/DSS_XP),%q3))] experience points.),[ansi(rh,-)] You dont know the [ansi(y,edit(%q2,_,%b))] language.)],[ansi(rh,-)] Invalid feat or language name.),[ulocal(v(DB_Database)/MSG_NoTraits)])]
&CMD_LOWER DSS Chargen Commands=$+lower * to *:@pemit %#=[setq(0,ulocal(v(DB_Database)/FN_Parse_Attr,secure(%0)))][setq(1,ulocal(v(DB_Database)/FN_Parse_Skill,secure(%0)))][ifelse(ulocal(v(DB_Database)/FN_HasSkills,%#),switch([t(words(%q0))][t(words(%q1))],1*,[setq(2,max(40,val(secure(%1))))][setq(3,ulocal(v(DB_Database)/FN_Attr_Cost,%#,%q0,%q2))][ifelse(lte(%q3,0),[ulocal(v(DB_Database)/FN_SetAttr,%#,%q0,%q2)][set(%#,DSS_XP:[sub(get(%#/DSS_XP),%q3)])][ansi(gh,-)] You +lower your [ansi(y,%q0)] to [ansi(y,%q2)] with a refund of [ansi(y,mul(-1,%q3))] experience points.,[ansi(rh,-)] You cannot +raise [ansi(y,%q0)] with +lower.)],01,[setq(2,max(0,val(secure(%1))))][setq(3,ulocal(v(DB_Database)/FN_Skill_Cost,%#,%q1,%q2))][ifelse(lte(%q3,0),[ulocal(v(DB_Database)/FN_SetSkill,%#,%q1,%q2)][set(%#,DSS_XP:[sub(get(%#/DSS_XP),%q3)])][ansi(gh,-)] You +lower your [ansi(y,%q1)] to [ansi(y,%q2)] with a refund of [ansi(y,mul(-1,%q3))] experience points.,[ansi(rh,-)] You cannot +raise [ansi(y,%q0)] with +lower.)],[ulocal(v(DB_Database)/MSG_NotName)]),[ulocal(v(DB_Database)/MSG_NoTraits)])]
&CMD_RESET DSS Chargen Commands=$+reset:@pemit %#=[setq(0,grab(sort(lattr(%!/RACE_*),a),RACE_[edit(squish(secure(get(%#/Species))),%b,_)]))][ifelse(words(%q0),,setq(0,RACE_Human))][setq(1,v(%q0))]You [ifelse(ulocal(v(DB_Database)/FN_HasSkills,%#),reinitialize,initialize)] your skill data.[set(%#,FIXED)][set(%#,DSS_XP:[extract(%q1,1,1,$)])][set(%#,DSS_Attrs:[vadd(setr(2,ulocal(v(DB_Database)/FN_Attr_Mods,%#)),setr(3,40 40 40 40 40 40))]|[%q2]|[%q3])][wipe(%#/Skills`*)][attrib_set(%#/skills)][set(%#,DSS_Feats:[extract(%q1,3,1,$)])][set(%#,DSS_Languages:[extract(%q1,4,1,$)])][set(%#,DSS_Lingo:[first(extract(%q1,4,1,$))])][set(%#,DSS_SP:0)][wipe(%#/DSS_Armor)][wipe(%#/DSS_Weapon)][ulocal(v(DB_Database)/FN_Update_Skills,%#)]
&DB_DATABASE DSS Chargen Commands=#156
@DESCRIBE DSS Chargen Commands=%tIn this phase of chargen, you may select your skills and/or feats. Useful commands in this room are as follows:%r%r%b%b[ansi(rh,+reset)] - Resets your character sheet.%r%b%b[ansi(rh,+sinfo)] [ansi(y,\[\])] - Displays documentation about the skills system.%r%b%b[ansi(rh,+sheet)] - Displays all your skills information.%r%b%b[ansi(rh,+sinfo)] [ansi(y,list attributes)] - Displays what skills the system has.%r%b%b[ansi(rh,+sinfo)] [ansi(y,list skills)] - Displays what skills the system has.%r%b%b[ansi(rh,+raise)] [ansi(y,)] [ansi(rh,to)] [ansi(y,)] - Raises a attribute or skill.%r%b%b[ansi(rh,+lower)] [ansi(y,)] [ansi(rh,to)] [ansi(y,)] - Lowers a attribute or skill.%r%b%b[ansi(rh,+sinfo)] [ansi(y,list feats)] - Lists all feats players can select.%r%b%b[ansi(rh,+sinfo)] [ansi(y,list languages)] - Lists all feats players can select.%r%b%b[ansi(rh,+select)] [ansi(y,)] - Adds that feat or language to your sheet.%r%b%b[ansi(rh,+deselect)] [ansi(y,)] - Removes that feat or language from your sheet.
@set DSS Chargen Commands/DESCRIBE=no_command visual prefixmatch public nearby
&RACE_HUMAN DSS Chargen Commands=800$$$English