// Function from file: admin_ranks.dm public void process_keyword(dynamic word = null, dynamic previous_rights = null) { previous_rights = previous_rights ?? 0; dynamic flag = null; Type path = null; flag = GlobalFuncs.admin_keyword_to_flag(word, previous_rights); if (Lang13.Bool(flag)) { switch ((int)(String13.GetCharCode(word, 1))) { case 43: this.rights |= flag; break; case 45: this.rights &= ~flag; break; } } else { path = GlobalFuncs.admin_keyword_to_path(word); if (path != null) { switch ((int)(String13.GetCharCode(word, 1))) { case 43: if (!this.subs.Remove(path)) { this.adds.Add(path); } break; case 45: if (!this.adds.Remove(path)) { this.subs.Add(path); } break; } } } return; }
// Function from file: other_reagents.dm public override double reaction_mob(dynamic M = null, int?method = null, double?reac_volume = null, bool?show_message = null, dynamic touch_protection = null, Mob_Camera_Blob O = null) { method = method ?? GlobalVars.TOUCH; show_message = show_message ?? true; dynamic N = null; string newcolor = null; int? len = null; int? i = null; int ascii = 0; if (M is Mob_Living_Carbon_Human) { if (method == GlobalVars.PATCH || method == GlobalVars.VAPOR) { N = M; if (N.dna.species.id == "human") { dynamic _a = N.skin_tone; // Was a switch-case, sorry for the mess. if (_a == "african1") { N.skin_tone = "african2"; } else if (_a == "indian") { N.skin_tone = "african1"; } else if (_a == "arab") { N.skin_tone = "indian"; } else if (_a == "asian2") { N.skin_tone = "arab"; } else if (_a == "asian1") { N.skin_tone = "asian2"; } else if (_a == "mediterranean") { N.skin_tone = "african1"; } else if (_a == "latino") { N.skin_tone = "mediterranean"; } else if (_a == "caucasian3") { N.skin_tone = "mediterranean"; } else if (_a == "caucasian2") { N.skin_tone = Rand13.Pick(new object [] { "caucasian3", "latino" }); } else if (_a == "caucasian1") { N.skin_tone = "caucasian2"; } else if (_a == "albino") { N.skin_tone = "caucasian1"; } } if (N.dna.species.specflags.Contains(1)) { newcolor = ""; len = Lang13.Length(N.dna.features["mcolor"]); i = null; i = 1; while ((i ?? 0) <= (len ?? 0)) { ascii = String13.GetCharCode(N.dna.features["mcolor"], i); dynamic _b = ascii; // Was a switch-case, sorry for the mess. if (49 <= _b && _b <= 57) { newcolor += String13.GetCharFromCode(ascii - 1); } else if (98 <= _b && _b <= 102) { newcolor += String13.GetCharFromCode(ascii - 1); } else if (66 <= _b && _b <= 70) { newcolor += String13.GetCharFromCode(ascii + 31); } else if (_b == 48) { newcolor += "0"; } else if (_b == 97) { newcolor += "9"; } else if (_b == 65) { newcolor += "9"; } else { break; } i += 1; } if (Convert.ToDouble(GlobalFuncs.ReadHSV(newcolor)[3]) >= Convert.ToDouble(GlobalFuncs.ReadHSV("#7F7F7F")[3])) { N.dna.features["mcolor"] = newcolor; } } ((Mob)N).regenerate_icons(); } if (method == GlobalVars.INGEST) { if (show_message == true) { M.WriteMsg("<span class='notice'>That tasted horrible.</span>"); } ((Mob)M).AdjustStunned(2); ((Mob)M).AdjustWeakened(2); } } base.reaction_mob((object)(M), method, reac_volume, show_message, (object)(touch_protection), O); return(0); }
// Function from file: musician.dm public void playsong( Mob user = null ) { ByTable cur_oct = null; ByTable cur_acc = null; double i = 0; dynamic line = null; dynamic beat = null; ByTable notes = null; dynamic note = null; int cur_note = 0; double i2 = 0; string ni = null; while (this.repeat >= 0) { cur_oct = null; cur_oct = new ByTable( 7 ); cur_acc = null; cur_acc = new ByTable( 7 ); foreach (dynamic _a in Lang13.IterateRange( 1, 7 )) { i = _a; cur_oct[i] = 3; cur_acc[i] = "n"; } foreach (dynamic _e in Lang13.Enumerate( this.lines )) { line = _e; foreach (dynamic _d in Lang13.Enumerate( GlobalFuncs.splittext( String13.ToLower( line ), "," ) )) { beat = _d; notes = GlobalFuncs.splittext( beat, "/" ); foreach (dynamic _c in Lang13.Enumerate( GlobalFuncs.splittext( notes[1], "-" ) )) { note = _c; if ( !this.playing || this.shouldStopPlaying( user ) ) { this.playing = false; return; } if ( Lang13.Length( note ) == 0 ) { continue; } cur_note = String13.GetCharCode( note, null ) - 96; if ( cur_note < 1 || cur_note > 7 ) { continue; } foreach (dynamic _b in Lang13.IterateRange( 2, Lang13.Length( note ) )) { i2 = _b; ni = String13.SubStr( note, ((int)( i2 )), ((int)( i2 + 1 )) ); if ( !Lang13.Bool( String13.ParseNumber( ni ) ) ) { if ( ni == "#" || ni == "b" || ni == "n" ) { cur_acc[cur_note] = ni; } else if ( ni == "s" ) { cur_acc[cur_note] = "#"; } } else { cur_oct[cur_note] = String13.ParseNumber( ni ); } } this.playnote( cur_note, cur_acc[cur_note], Convert.ToInt32( cur_oct[cur_note] ) ); } if ( notes.len >= 2 && Lang13.Bool( String13.ParseNumber( notes[2] ) ) ) { Task13.Sleep( this.sanitize_tempo( this.tempo / ( String13.ParseNumber( notes[2] ) ??0) ) ); } else { Task13.Sleep( ((int)( this.tempo )) ); } } } this.repeat--; if ( this.repeat >= 0 ) { this.updateDialog( user ); } } this.playing = false; this.repeat = 0; this.updateDialog( user ); return; }