-static void ch_sizenear(const char *args)
-{
- int closest = findClosestPlayer();
- if (closest >= 0)
- Person::players[closest]->scale = atof(args) * .2;
-}
-
-static void set_proportion(int pnum, const char *args)
-{
- float headprop, bodyprop, armprop, legprop;
-
- sscanf(args, "%f%f%f%f", &headprop, &bodyprop, &armprop, &legprop);
-
- if (Person::players[pnum]->creature == wolftype) {
- Person::players[pnum]->proportionhead = 1.1 * headprop;
- Person::players[pnum]->proportionbody = 1.1 * bodyprop;
- Person::players[pnum]->proportionarms = 1.1 * armprop;
- Person::players[pnum]->proportionlegs = 1.1 * legprop;
- } else if (Person::players[pnum]->creature == rabbittype) {
- Person::players[pnum]->proportionhead = 1.2 * headprop;
- Person::players[pnum]->proportionbody = 1.05 * bodyprop;
- Person::players[pnum]->proportionarms = 1.00 * armprop;
- Person::players[pnum]->proportionlegs = 1.1 * legprop;
- Person::players[pnum]->proportionlegs.y = 1.05 * legprop;
- }
-}
-
-static void ch_proportion(const char *args)
-{
- set_proportion(0, args);
-}
-
-static void ch_proportionnear(const char *args)
-{
- int closest = findClosestPlayer();
- if (closest >= 0)
- set_proportion(closest, args);
-}
-
-static void set_protection(int pnum, const char *args)
-{
- float head, high, low;
- sscanf(args, "%f%f%f", &head, &high, &low);
-
- Person::players[pnum]->protectionhead = head;
- Person::players[pnum]->protectionhigh = high;
- Person::players[pnum]->protectionlow = low;
-}
-
-static void ch_protection(const char *args)
-{
- set_protection(0, args);
-}
-
-static void ch_protectionnear(const char *args)
-{
- int closest = findClosestPlayer();
- if (closest >= 0)
- set_protection(closest, args);
-}
-
-static void set_armor(int pnum, const char *args)
-{
- float head, high, low;
- sscanf(args, "%f%f%f", &head, &high, &low);
-
- Person::players[pnum]->armorhead = head;
- Person::players[pnum]->armorhigh = high;
- Person::players[pnum]->armorlow = low;
-}
-
-static void ch_armor(const char *args)
-{
- set_armor(0, args);
-}
-
-static void ch_armornear(const char *args)
-{
- int closest = findClosestPlayer();
- if (closest >= 0)
- set_armor(closest, args);
-}
-
-static void ch_protectionreset(const char *args)
-{
- set_protection(0, "1 1 1");
- set_armor(0, "1 1 1");
-}
-
-static void set_metal(int pnum, const char *args)
-{
- float head, high, low;
- sscanf(args, "%f%f%f", &head, &high, &low);
-
- Person::players[pnum]->metalhead = head;
- Person::players[pnum]->metalhigh = high;
- Person::players[pnum]->metallow = low;
-}
-
-static void ch_metal(const char *args)
-{
- set_metal(0, args);
-}
-
-static void set_noclothes(int pnum, const char *args)
-{
- Person::players[pnum]->numclothes = 0;
- Person::players[pnum]->skeleton.drawmodel.textureptr.load(
- creatureskin[Person::players[pnum]->creature][Person::players[pnum]->whichskin], 1,
- &Person::players[pnum]->skeleton.skinText[0], &Person::players[pnum]->skeleton.skinsize);
-}
-
-static void ch_noclothes(const char *args)
-{
- set_noclothes(0, args);
-}
-
-static void ch_noclothesnear(const char *args)
-{
- int closest = findClosestPlayer();
- if (closest >= 0)
- set_noclothes(closest, args);
-}
-
-
-static void set_clothes(int pnum, const char *args)
-{
- char buf[64];
- snprintf(buf, 63, ":Data:Textures:%s.png", args);
-
- if (!AddClothes(buf, &Person::players[pnum]->skeleton.skinText[pnum]))
- return;
-
- Person::players[pnum]->DoMipmaps();
- strcpy(Person::players[pnum]->clothes[Person::players[pnum]->numclothes], buf);
- Person::players[pnum]->clothestintr[Person::players[pnum]->numclothes] = tintr;
- Person::players[pnum]->clothestintg[Person::players[pnum]->numclothes] = tintg;
- Person::players[pnum]->clothestintb[Person::players[pnum]->numclothes] = tintb;
- Person::players[pnum]->numclothes++;
-}
-
-static void ch_clothes(const char *args)
-{
- set_clothes(0, args);
-}
-
-static void ch_clothesnear(const char *args)
-{
- int closest = findClosestPlayer();
- if (closest >= 0)
- set_clothes(closest, args);
-}
-
-static void ch_belt(const char *args)
-{
- Person::players[0]->skeleton.clothes = !Person::players[0]->skeleton.clothes;
-}
-
-
-static void ch_cellophane(const char *args)
-{
- cellophane = !cellophane;
- float mul = (cellophane ? 0 : 1);
-
- for (auto player : Person::players) {
- player->proportionhead.z = player->proportionhead.x * mul;
- player->proportionbody.z = player->proportionbody.x * mul;
- player->proportionarms.z = player->proportionarms.x * mul;
- player->proportionlegs.z = player->proportionlegs.x * mul;
- }
-}
-
-static void ch_funnybunny(const char *args)
-{
- Person::players[0]->skeleton.id = 0;
- Person::players[0]->skeleton.Load(":Data:Skeleton:Basic Figure", ":Data:Skeleton:Basic Figurelow",
- ":Data:Skeleton:Rabbitbelt", ":Data:Models:Body.solid",
- ":Data:Models:Body2.solid", ":Data:Models:Body3.solid",
- ":Data:Models:Body4.solid", ":Data:Models:Body5.solid",
- ":Data:Models:Body6.solid", ":Data:Models:Body7.solid",
- ":Data:Models:Bodylow.solid", ":Data:Models:Belt.solid", 1);
- Person::players[0]->skeleton.drawmodel.textureptr.load(":Data:Textures:fur3.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize);
- Person::players[0]->creature = rabbittype;
- Person::players[0]->scale = .2;
- Person::players[0]->headless = 0;
- Person::players[0]->damagetolerance = 200;
- set_proportion(0, "1 1 1 1");
-}
-
-static void ch_wolfie(const char *args)
-{
- Person::players[0]->skeleton.id = 0;
- Person::players[0]->skeleton.Load(":Data:Skeleton:Basic Figure Wolf", ":Data:Skeleton:Basic Figure Wolf Low",
- ":Data:Skeleton:Rabbitbelt", ":Data:Models:Wolf.solid",
- ":Data:Models:Wolf2.solid", ":Data:Models:Wolf3.solid",
- ":Data:Models:Wolf4.solid", ":Data:Models:Wolf5.solid",
- ":Data:Models:Wolf6.solid", ":Data:Models:Wolf7.solid",
- ":Data:Models:Wolflow.solid", ":Data:Models:Belt.solid", 0);
- Person::players[0]->skeleton.drawmodel.textureptr.load(":Data:Textures:Wolf.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize);
- Person::players[0]->creature = wolftype;
- Person::players[0]->damagetolerance = 300;
- set_proportion(0, "1 1 1 1");
-}
-
-static void ch_wolfieisgod(const char *args)
-{
- ch_wolfie(args);
-}
-
-static void ch_wolf(const char *args)
-{
- Person::players[0]->skeleton.drawmodel.textureptr.load(":Data:Textures:Wolf.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize);
-}
-
-static void ch_snowwolf(const char *args)
-{
- Person::players[0]->skeleton.drawmodel.textureptr.load(":Data:Textures:SnowWolf.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize);
-}
-
-static void ch_darkwolf(const char *args)
-{
- Person::players[0]->skeleton.drawmodel.textureptr.load(":Data:Textures:DarkWolf.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize);
-}
-
-static void ch_lizardwolf(const char *args)
-{
- Person::players[0]->skeleton.drawmodel.textureptr.load(":Data:Textures:Lizardwolf.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize);
-}
-
-static void ch_white(const char *args)
-{
- Person::players[0]->skeleton.drawmodel.textureptr.load(":Data:Textures:fur.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize);
-}
-
-static void ch_brown(const char *args)
-{
- Person::players[0]->skeleton.drawmodel.textureptr.load(":Data:Textures:fur3.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize);
-}
-
-static void ch_black(const char *args)
-{
- Person::players[0]->skeleton.drawmodel.textureptr.load(":Data:Textures:fur2.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize);
-}
-
-static void ch_sizemin(const char *args)
-{
- for (unsigned i = 1; i < Person::players.size(); i++)
- if (Person::players[i]->scale < 0.8 * 0.2)
- Person::players[i]->scale = 0.8 * 0.2;
-}
-
-static void ch_tutorial(const char *args)
-{
- tutoriallevel = atoi(args);
-}
-
-static void ch_hostile(const char *args)
-{
- hostile = atoi(args);
-}
-
-static void ch_indemo(const char *args)
-{
- indemo = 1;
- hotspot[numhotspots] = Person::players[0]->coords;
- hotspotsize[numhotspots] = 0;
- hotspottype[numhotspots] = -111;
- strcpy(hotspottext[numhotspots], "mapname");
- numhotspots++;
-}
-
-static void ch_notindemo(const char *args)
-{
- indemo = 0;
- numhotspots--;
-}
-
-static void ch_type(const char *args)
-{
- int n = sizeof(editortypenames) / sizeof(editortypenames[0]);
- for (int i = 0; i < n; i++)
- if (stripfx(args, editortypenames[i])) {
- editoractive = i;
- break;
- }
-}
-
-static void ch_path(const char *args)
-{
- int n = sizeof(pathtypenames) / sizeof(pathtypenames[0]);
- for (int i = 0; i < n; i++)
- if (stripfx(args, pathtypenames[i])) {
- editorpathtype = i;
- break;
- }
-}
-
-static void ch_hs(const char *args)
-{
- hotspot[numhotspots] = Person::players[0]->coords;
-
- float size;
- int type, shift;
- sscanf(args, "%f%d %n", &size, &type, &shift);
-
- hotspotsize[numhotspots] = size;
- hotspottype[numhotspots] = type;
-
- strcpy(hotspottext[numhotspots], args + shift);
- strcat(hotspottext[numhotspots], "\n");
-
- numhotspots++;
-}
-
-static void ch_dialogue(const char *args)
-{
- int dlg;
- char buf1[32], buf2[64];
-
- sscanf(args, "%d %31s", &dlg, buf1);
- snprintf(buf2, 63, ":Data:Dialogues:%s.txt", buf1);
-
- dialoguetype[numdialogues] = dlg;
-
- memset(dialoguetext[numdialogues], 0, sizeof(dialoguetext[numdialogues]));
- memset(dialoguename[numdialogues], 0, sizeof(dialoguename[numdialogues]));
-
- ifstream ipstream(ConvertFileName(buf2));
- ipstream.ignore(256, ':');
- ipstream >> numdialogueboxes[numdialogues];
- for (int i = 0; i < numdialogueboxes[numdialogues]; i++) {
- ipstream.ignore(256, ':');
- ipstream.ignore(256, ':');
- ipstream.ignore(256, ' ');
- ipstream >> dialogueboxlocation[numdialogues][i];
- ipstream.ignore(256, ':');
- ipstream >> dialogueboxcolor[numdialogues][i][0];
- ipstream >> dialogueboxcolor[numdialogues][i][1];
- ipstream >> dialogueboxcolor[numdialogues][i][2];
- ipstream.ignore(256, ':');
- ipstream.getline(dialoguename[numdialogues][i], 64);
- ipstream.ignore(256, ':');
- ipstream.ignore(256, ' ');
- ipstream.getline(dialoguetext[numdialogues][i], 128);
- for (int j = 0; j < 128; j++) {
- if (dialoguetext[numdialogues][i][j] == '\\')
- dialoguetext[numdialogues][i][j] = '\n';
- }
- ipstream.ignore(256, ':');
- ipstream >> dialogueboxsound[numdialogues][i];
- }
-
- for (int i = 0; i < numdialogueboxes[numdialogues]; i++) {
- for (unsigned j = 0; j < Person::players.size(); j++) {
- participantfacing[numdialogues][i][j] = Person::players[j]->facing;
- }
- }
- ipstream.close();
-
- directing = 1;
- indialogue = 0;
- whichdialogue = numdialogues;
-
- numdialogues++;
-}
-
-static void ch_fixdialogue(const char *args)
-{
- char buf1[32], buf2[64];
- int whichdi;
-
- sscanf(args, "%d %31s", &whichdi, buf1);
- snprintf(buf2, 63, ":Data:Dialogues:%s.txt", buf1);
-
- memset(dialoguetext[whichdi], 0, sizeof(dialoguetext[whichdi]));
- memset(dialoguename[whichdi], 0, sizeof(dialoguename[whichdi]));
-
- ifstream ipstream(ConvertFileName(buf2));
- ipstream.ignore(256, ':');
- ipstream >> numdialogueboxes[whichdi];
- for (int i = 0; i < numdialogueboxes[whichdi]; i++) {
- ipstream.ignore(256, ':');
- ipstream.ignore(256, ':');
- ipstream.ignore(256, ' ');
- ipstream >> dialogueboxlocation[whichdi][i];
- ipstream.ignore(256, ':');
- ipstream >> dialogueboxcolor[whichdi][i][0];
- ipstream >> dialogueboxcolor[whichdi][i][1];
- ipstream >> dialogueboxcolor[whichdi][i][2];
- ipstream.ignore(256, ':');
- ipstream.getline(dialoguename[whichdi][i], 64);
- ipstream.ignore(256, ':');
- ipstream.ignore(256, ' ');
- ipstream.getline(dialoguetext[whichdi][i], 128);
- for (int j = 0; j < 128; j++) {
- if (dialoguetext[whichdi][i][j] == '\\')
- dialoguetext[whichdi][i][j] = '\n';
- }
- ipstream.ignore(256, ':');
- ipstream >> dialogueboxsound[whichdi][i];
- }
-
- ipstream.close();
-}
-
-static void ch_fixtype(const char *args)
-{
- int dlg;
- sscanf(args, "%d", &dlg);
- dialoguetype[0] = dlg;
-}
-
-static void ch_fixrotation(const char *args)
-{
- participantyaw[whichdialogue][participantfocus[whichdialogue][indialogue]] = Person::players[participantfocus[whichdialogue][indialogue]]->yaw;
-}
-
-static void ch_ddialogue(const char *args)
-{
- if (numdialogues)
- numdialogues--;
-}
-
-static void ch_dhs(const char *args)
-{
- if (numhotspots)
- numhotspots--;
-}
-
-static void ch_immobile(const char *args)
-{
- Person::players[0]->immobile = 1;
-}
-
-static void ch_allimmobile(const char *args)
-{
- for (unsigned i = 1; i < Person::players.size(); i++)
- Person::players[i]->immobile = 1;
-}
-
-static void ch_mobile(const char *args)
-{
- Person::players[0]->immobile = 0;
-}
-
-static void ch_default(const char *args)
-{
- Person::players[0]->armorhead = 1;
- Person::players[0]->armorhigh = 1;
- Person::players[0]->armorlow = 1;
- Person::players[0]->protectionhead = 1;
- Person::players[0]->protectionhigh = 1;
- Person::players[0]->protectionlow = 1;
- Person::players[0]->metalhead = 1;
- Person::players[0]->metalhigh = 1;
- Person::players[0]->metallow = 1;
- Person::players[0]->power = 1;
- Person::players[0]->speedmult = 1;
- Person::players[0]->scale = 1;
-
- if (Person::players[0]->creature == wolftype) {
- Person::players[0]->proportionhead = 1.1;
- Person::players[0]->proportionbody = 1.1;
- Person::players[0]->proportionarms = 1.1;
- Person::players[0]->proportionlegs = 1.1;
- } else if (Person::players[0]->creature == rabbittype) {
- Person::players[0]->proportionhead = 1.2;
- Person::players[0]->proportionbody = 1.05;
- Person::players[0]->proportionarms = 1.00;
- Person::players[0]->proportionlegs = 1.1;
- Person::players[0]->proportionlegs.y = 1.05;
- }
-
- Person::players[0]->numclothes = 0;
- Person::players[0]->skeleton.drawmodel.textureptr.load(
- creatureskin[Person::players[0]->creature][Person::players[0]->whichskin], 1,
- &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize);
-
- editoractive = typeactive;
- Person::players[0]->immobile = 0;
-}
-
-static void ch_play(const char *args)
-{
- int dlg;
- sscanf(args, "%d", &dlg);
- whichdialogue = dlg;
-
- if (whichdialogue >= numdialogues)
- return;
-
- for (int i = 0; i < numdialogueboxes[whichdialogue]; i++) {
- Person::players[participantfocus[whichdialogue][i]]->coords = participantlocation[whichdialogue][participantfocus[whichdialogue][i]];
- Person::players[participantfocus[whichdialogue][i]]->yaw = participantyaw[whichdialogue][participantfocus[whichdialogue][i]];
- Person::players[participantfocus[whichdialogue][i]]->targetyaw = participantyaw[whichdialogue][participantfocus[whichdialogue][i]];
- Person::players[participantfocus[whichdialogue][i]]->velocity = 0;
- Person::players[participantfocus[whichdialogue][i]]->animTarget = Person::players[participantfocus[whichdialogue][i]]->getIdle();
- Person::players[participantfocus[whichdialogue][i]]->frameTarget = 0;
- }
-
- directing = 0;
- indialogue = 0;
-
- playdialogueboxsound();
-}
-
-static void ch_mapkilleveryone(const char *args)
-{
- maptype = mapkilleveryone;
-}
-
-static void ch_mapkillmost(const char *args)
-{
- maptype = mapkillmost;
-}
-
-static void ch_mapkillsomeone(const char *args)
-{
- maptype = mapkillsomeone;
-}
-
-static void ch_mapgosomewhere(const char *args)
-{
- maptype = mapgosomewhere;
-}
-
-static void ch_viewdistance(const char *args)
-{
- viewdistance = atof(args) * 100;
-}
-
-static void ch_fadestart(const char *args)
-{
- fadestart = atof(args);
-}
-
-static void ch_slomo(const char *args)
-{
- slomospeed = atof(args);
- slomo = !slomo;
- slomodelay = 1000;
-}
-
-static void ch_slofreq(const char *args)
-{
- slomofreq = atof(args);
-}
-
-static void ch_skytint(const char *args)
-{
- sscanf(args, "%f%f%f", &skyboxr, &skyboxg, &skyboxb);
-
- skyboxlightr = skyboxr;
- skyboxlightg = skyboxg;
- skyboxlightb = skyboxb;
-
- SetUpLighting();
-
- terrain.DoShadows();
- objects.DoShadows();
-}
-
-static void ch_skylight(const char *args)
-{
- sscanf(args, "%f%f%f", &skyboxlightr, &skyboxlightg, &skyboxlightb);
-
- SetUpLighting();
-
- terrain.DoShadows();
- objects.DoShadows();
-}
-
-static void ch_skybox(const char *args)
-{
- skyboxtexture = !skyboxtexture;
-
- SetUpLighting();
-
- terrain.DoShadows();
- objects.DoShadows();
-}
-