forked from ccubed/RFK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode core backup.txt
47 lines (47 loc) · 9.67 KB
/
code core backup.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FUNCTIONS [#5`]: Core functions which all systems will use.
FUNCTIONS`DATA.DATE_TIME_VALID_REGEX [#1905]: ^\[0-9\]\{4\}-\(\(\(0\[13578\]|\(10|12\)\)-\(0\[1-9\]|\[1-2\]\[0-9\]|3\[0-1\]\)\)|\(02-\(0\[1-9\]|\[1-2\]\[0-9\]\)\)|\(\(0\[469\]|11\)-\(0\[1-9\]|\[1-2\]\[0-9\]|30\)\)) (\[012\]\[01234\]:\[012345\]\\d:\[012345\]\\d\)$
FUNCTIONS`DATA.DATE_VALID_REGEX [#1905]: ^\[0-9\]\{4\}-\(\(\(0\[13578\]|\(10|12\)\)-\(0\[1-9\]|\[1-2\]\[0-9\]|3\[0-1\]\)\)|\(02-\(0\[1-9\]|\[1-2\]\[0-9\]\)\)|\(\(0\[469\]|11\)-\(0\[1-9\]|\[1-2\]\[0-9\]|30\)\)\)$
FUNCTIONS`FUN [#5]: Fun.functionname for @startup @function declaration.
FUNCTIONS`FUN.ACTIVE_PC_FILTER [#1905]: [if(eq([get(%0/CHARGEN`APPROVED)][if_active_pc(%0)],11),1,0)]
FUNCTIONS`FUN.ACTIVE_PC_LIST [#1905]: [filter(%wc/FUNCTIONS`FUN.ACTIVE_PC_FILTER,[lsearch(all,type,player)])]
FUNCTIONS`FUN.APOSTROPHE_NAME [#5]: [setr(NAME,[name(*%0)][if([strmatch([right([name(*%0)],1)],s)],','s)])]
FUNCTIONS`FUN.DATE_TIME_VALID [#1905]: [regmatch(%0,[u(%wc/FUNCTIONS`DATA.DATE_TIME_VALID_REGEX)])]
FUNCTIONS`FUN.DATE_VALID [#1905]: [regmatch(%0,[u(%wc/FUNCTIONS`DATA.DATE_VALID_REGEX)])]
FUNCTIONS`FUN.GET_ATTRIB [#5]: [setq(STAT,[map_attrib(%1)])][if([not([strmatch(%q<STAT>,ERROR)])],[if([hasattrval(%0/PC_DATA`ATTRIBS`%q<STAT>)],[get(%0/PC_DATA`ATTRIBS`%q<STAT>)],0)],0)]
FUNCTIONS`FUN.GET_CLAN [#1905]: [get(%0/PC_DATA`CLAN)]
FUNCTIONS`FUN.GET_DEFENSE_ARMED [#1905]: [add([get_defense_armed_base(%0)],[get(%0/PC_DATA`STATUS`ARMED_DEFENSE_MOD)])]
FUNCTIONS`FUN.GET_DEFENSE_ARMED_BASE [#1905]: [setq(m,0)][if([not(%qm)],[setq(m,[if([has_merit(%0,Defensive Combat Weaponry)],[get_skill(%0,Weaponry)],0)])])][add([min([get_attrib(%0,Wits)],[get_attrib(%0,Dexterity)])],[max([get_skill(%0,Athletics)],%qm)],[get_discipline(%0,Celerity)])]
FUNCTIONS`FUN.GET_DEFENSE_UNARMED [#1905]: [add([get_defense_unarmed_base(%0)],[get(%0/PC_DATA`STATUS`UNARMED_DEFENSE_MOD)])]
FUNCTIONS`FUN.GET_DEFENSE_UNARMED_BASE [#1905]: [setq(m,0)][if([not(%qm)],[setq(m,[if([has_merit(%0,Defensive Combat Brawl)],[get_skill(%0,Brawl)],0)])])][add([min([get_attrib(%0,Wits)],[get_attrib(%0,Dexterity)])],[max([get_skill(%0,Athletics)],%qm)],[get_discipline(%0,Celerity)])]
FUNCTIONS`FUN.GET_DISCIPLINE [#5]: [setq(t,0)][unsetq(GDISCIPLINE)][setq(GDISCIPLINE,%1)][iter([get(%0/PC_DATA`DISCIPLINES)],[if([strmatch(%i0,%q<GDISCIPLINE>:*)],[elements(%i0,2,:)][setq(t,1)][ibreak()])],|,)][if([not(%qt)],[t(%qt)])]
FUNCTIONS`FUN.GET_DISCIPLINE_THEME [#5]: [setq(t,0)][unsetq(GTHEME)][setq(GTHEME,%1)][iter([get(%0/PC_DATA`DISCIPLINES.THEMES)],[if([strmatch(%i0,%q<GTHEME>:*)],[elements(%i0,2,:)][setq(t,1)][ibreak()])],|,)][if([not(%qt)],[t(%qt)])]
FUNCTIONS`FUN.GET_HP [#5]: [switch(%1,current,[get(%0/PC_DATA`STATUS`HP)],max,[add([get_attrib(%0,stamina)],[get(%0/PC_DATA`SIZE)])],[pemit(%0, BUG: Get_HP did not accept 'current' or 'max'. Please report to Kougyoku.)])]
FUNCTIONS`FUN.GET_INIT_MOD [#1905]: [add([get_init_mod_base(%0)],[get(%0/PC_DATA`STATUS`INIT_MOD_MOD)])]
&FUNCTIONS`FUN.GET_INIT_MOD_BASE #1706=[add([get_attrib(%0,Dexterity)],[get_attrib(%0,Composure)],[u(#4079/FN.GET.STAT,%0,Merit,Fast Reflexes)])]
FUNCTIONS`FUN.GET_MERIT [#5]: [setq(t,0)][unsetq(GMERIT)][setq(GMERIT,[edit(%1,_,[space(1)])])][iter([get(%0/PC_DATA`MERITS)],[if([strmatch(%i0,%q<GMERIT>:*)],[elements(%i0,2,:)][setq(t,1)][ibreak()])],|,)][if([not(%qt)],[t(%qt)])]
FUNCTIONS`FUN.GET_PERCENTAGE [#5]: [setq(p,[floor([div([mul(%0,100)],%1)])])]%qp
FUNCTIONS`FUN.GET_SKILL [#5]: [setq(t,0)][unsetq(GSKILL)][setq(GSKILL,%1)][iter([strcat([get(%0/PC_DATA`SKILL.MENTAL)],|[get(%0/PC_DATA`SKILL.PHYSICAL)],|[get(%0/PC_DATA`SKILL.SOCIAL)])],[if([strmatch(%i0,%q<GSKILL>:*)],[elements(%i0,2,:)][setq(t,1)][ibreak()])],|,)][if([not(%qt)],[t(%qt)])]
FUNCTIONS`FUN.GET_SPEED [#1905]: [add([get_attrib(%0,Strength)],[get_attrib(%0,Dexterity)],5,[get_merit(%0,Fleet of Foot)],[get(%0/PC_DATA`STATUS`SPEED_MOD)])]
FUNCTIONS`FUN.GET_TEMPLATE [#5]: [get(%0/PC_DATA`TEMPLATE)]
FUNCTIONS`FUN.GET_TYPE [#5]: [setq(t,0)][setq(TYPE,0)][iter([get(%wl/CG_LIST`ATTRIBUTE.FOR_TABLE)],[if([strmatch(%0,%i0)],[setq(TYPE,ATTRIB)][setq(t,1)][ibreak()],[setq(t,0)])],|,)][if([not(%qt)],[iter([get(%wl/CG_LIST`SKILLS.FOR_TABLE)],[if([strmatch(%0,%i0)],[setq(TYPE,SKILL)][setq(t,1)][ibreak()],[setq(t,0)])],|,)])][if([not(%qt)],[iter([get(%wl/CG_LIST`MERITS`COST)],[if([strmatch(%i0,[edit(%0,[space(1)],_)]:*)],[setq(TYPE,MERIT)][setq(t,1)][ibreak()],[setq(t,0)])],|,)])][if([not(%qt)],[if([strmatch(%0,Spec_*)],[setq(TYPE,SPECIALTY)][setq(t,1)],[setq(t,0)])])][if([not(%qt)],[switch(%0,HUMAN,[setq(TYPE,TEMPLATE)][setq(t,1)],GHOUL,[setq(TYPE,TEMPLATE)][setq(t,1)],VAMPIRE,[setq(TYPE,TEMPLATE)][setq(t,1)],[setq(t,0)])])][if([not(%qt)],[iter([get(%wl/CG_LIST`COVENANT)],[if([strmatch(%0,%i0)],[setq(TYPE,COVENANT)][setq(t,1)][ibreak()],[setq(t,0)])],|,)])][if([not(%qt)],[iter([get(%wl/CG_LIST`CLAN)],[if([strmatch(%0,%i0)],[setq(TYPE,CLAN)][setq(t,1)][ibreak()],[setq(t,0)])],|,)])][if([not(%qt)],[iter([strcat([get(%wl/CG_LIST`DISCIPLINES.DOSTUFF)],|[get(%wl/CG_LIST`DISCIPLINES.PHYSICAL)],|[get(%wl/CG_LIST`DISCIPLINES.RITUAL)])],[if([strmatch(%0,%i0)],[setq(TYPE,DISCIPLINE)][setq(t,1)][ibreak()],[setq(t,0)])],|,)])][if([not(%qt)],[setq(TYPE,ERROR)])]%q<TYPE>
FUNCTIONS`FUN.GET_VITAE [#5]: [switch(%1,current,[get(%0/PC_DATA`STATUS`VITAE)],max,[switch([get_merit(%0,Blood Potency)],0,[get_attrib(%0,Stamina)],1,10,2,11,3,12,4,13,5,15,6,20,7,25,8,30,9,50,10,75)],per_round,[switch([get_merit(%0,Blood Potency)],0,1,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,10,10,15)],[pemit(%0, BUG: Get_Vitae did not accept 'current'\, 'max'\, or per_round. Please report to Kougyoku.)])]
FUNCTIONS`FUN.GET_WILLPOWER [#5]: [switch(%1,current,[get(%0/PC_DATA`STATUS`WILLPOWER)],max,[add([get_attrib(%0,resolve)],[get_attrib(%0,composure)],[get(%0/PC_DATA`STATUS`WILLPOWER`PURCHASED)])],[pemit(%0, BUG: Get_Willpower did not accept 'current' or 'max'. Please report to Kougyoku.)])]
FUNCTIONS`FUN.HAS_DISCIPLINE [#5]: [gt([get_discipline(%0,%1)],0)]
FUNCTIONS`FUN.HAS_MERIT [#3096]: [gt([get_merit(%0,%1)],0)]
FUNCTIONS`FUN.HAS_RITUAL [#5]: [iter([get(%0/PC_DATA`RITUALS)],[if([strmatch(%i0,%1)],[setq(s,1)][ibreak()],[setq(s,0)])],|,)]%qs
FUNCTIONS`FUN.HAS_SKILL [#5]: [gt([get_skill(%0,%1)],0)]
FUNCTIONS`FUN.HAS_SPECIALTY [#5]: [iter([get(%0/PC_DATA`SKILL.SPECIALTIES)],[if([strmatch(%i0,%1)],[setq(s,1)][ibreak()],[setq(s,0)])],|,)]%qs
FUNCTIONS`FUN.IF_ACTIVE_PC [#1905]: [setq(t,0)][if([and([not([get(%0/INACTIVE)])],[lte([sub([convtime([time()])],[convtime([get(%0/last)])])],604800)])],[setq(t,1)])][t(%qt)]
FUNCTIONS`FUN.IS_IMMORTAL [#5]: [orflags(*%0,Wr)]
FUNCTIONS`FUN.MAP_ATTRIB [#3096]: [switch(%0,Intelligence,[setq(STAT,INT)],Wits,[setq(STAT,WITS)],Resolve,[setq(STAT,RESOLVE)],Strength,[setq(STAT,STR)],Dexterity,[setq(STAT,DEX)],Stamina,[setq(STAT,STA)],Presence,[setq(STAT,PRE)],Manipulation,[setq(STAT,MANIP)],Composure,[setq(STAT,COMP)],[setq(STAT,ERROR)])]%q<STAT>
FUNCTIONS`FUN.MAP_MPS [#5]: [switch(%0,M,Mental,P,Physical,S,Social,Mental,M,Physical,P,Social,S,ERROR)]
FUNCTIONS`FUN.ROLL_DICE [#5]: [iter([lattr(%wc/ROLL`DICE`**)],[attrib_set(%wc/%i0,0)],,)][setq(NUM_DICE,%1)][setq(SUCC_NUM,8)][setq(FAIL_NUM,0)][switch(%0,/1,[setq(X_AGAIN,11)][setq(NUM_DICE,1)][setq(SUCC_NUM,10)][setq(FAIL_NUM,1)],/8,[setq(X_AGAIN,8)],/9,[setq(X_AGAIN,9)],/0,[setq(X_AGAIN,11)],/none,[setq(X_AGAIN,11)],[setq(X_AGAIN,10)])][attrib_set(%wc/ROLL`DICE`RESULT`BASE,[die(%q<NUM_DICE>,10,1)])][iter([get(%wc/ROLL`DICE`RESULT`BASE)],[if([lte(%i0,%q<FAIL_NUM>)],[attrib_set(%wc/ROLL`DICE`TOTAL.FAIL,[inc([get(%wc/ROLL`DICE`TOTAL.FAIL)])])])][if([gte(%i0,%q<SUCC_NUM>)],[attrib_set(%wc/ROLL`DICE`TOTAL.SUCC,[inc([get(%wc/ROLL`DICE`TOTAL.SUCC)])])][if([gte(%i0,%q<X_AGAIN>)],[attrib_set(%wc/ROLL`DICE`NUM.ED,[inc([get(%wc/ROLL`DICE`NUM.ED)])])])])],,)][if([gt([get(%wc/ROLL`DICE`NUM.ED)],0)],[u(%wc/ROLL`DICE.1,[get(%wc/ROLL`DICE`NUM.ED)])])][setq(NSUCC,[add([get(%wc/ROLL`DICE`TOTAL.SUCC)],[get(%wc/ROLL`DICE`TOTAL.EDSUCC)])])]%q<NSUCC>
FUNCTIONS`FUN.SET_HP [#5]: [if([isnum(%1)],[attrib_set2(%0/PC_DATA`STATUS`HP,[trim([round(%1,0)],0)])],[set_hp(%0,0)])]
FUNCTIONS`FUN.SET_VITAE [#1905]: [cemit(Debug,set_vitae called for: [name(%0)] Caller %@ Executor %#,NOISY)]
FUNCTIONS`FUN.SET_VITAE_NEW [#1905]: [attrib_set2(%0/PC_DATA`STATUS`VITAE,[round(%1,0)])][cemit(Debug,set_vitae_new called for: [name(%0)] Caller %@ Executor %# set to [round(%1,0)],NOISY)]
FUNCTIONS`FUN.SET_WILLPOWER [#5]: [attrib_set2(%0/PC_DATA`STATUS`WILLPOWER,[round(%1,0)])]
FUNCTIONS`FUN.SQL_DATE_TIME [#1905]: [timefmt($Y-$m-$d $H:$M:$S)]
FUNCTIONS`FUN.SQL_DBREF [#1905]: [trim([num(%0)],#)]
FUNCTIONS`FUN.SQL_DBREF_LIST [#1905]: [setq(LIST,%0)][setq(DELIM,%1)][map(FUNCTIONS`FUN.SQL_DBREF,%q<LIST>,[IF(%q<DELIM>,%q<DELIM>,[space(1)])],\,)]
FUNCTIONS`FUN.WIELDED [#3096b]: [iter([get(%0/PC_DATA`WIELDED)],[before([xget(#3637,%i0)],/)][space(1)]\([after([setq(0,[element([after(xget(#3637,%i0),/)],Init*,|)])][if(%q0,[extract([after(xget(#3637,%i0),/)],%q0,1,|)],0)],:)]\), ,\,[space(1)])]
CMD`ACCEPT [#3096]: $+accept *:@assert pmatch(%0)=@nspemit/silent %#=+accept: No such player by that name.; @assert get(*%0/CHARGEN`WAITING)=@nspemit/silent %#=+accept: [name(*%0)] is not waiting for approval.;@break [get(*%0/CHARGEN`APPROVED)]=@nspemit/silent %#=+accept: [name(*%0)] has already been approved.; @set *%0=CHARGEN`WAITING:0;@set *%0=CHARGEN`APPROVED:1;@set *%0=CHARGEN`APPROVAL_DATE:[time()]; @tr %ww/FN`FINALIZE_CHAR=*%0; @nspemit/silent %#=+accept: [apostrophe_name([name(*%0)])] application has been accepted. [capstr(subj(*%0))] may now go IC and interact with other characters. Please remember to +job/approve the player's request!; @mail %0=Application accepted./Congratulations! The administrators have accepted your application for a character on [mudname()]! You may now use your character in the IC grid. Remember, if you have any questions, don't hesitate to ask!; (#1773)