- case 14:
- sound = bark2sound;
- break;
- case 15:
- sound = bark3sound;
- break;
- case 16:
- sound = barkgrowlsound;
- break;
- default:
- break;
- }
- if (sound != -1)
- emit_sound_at(sound, temppos);
-}
-
-// ================================================================
-
-bool AddClothes(const char *fileName, GLubyte *array)
-{
- LOGFUNC;
- //Load Image
- unsigned char fileNamep[256];
- CopyCStringToPascal(fileName, fileNamep);
- bool opened;
- opened = upload_image( fileNamep , 1);
-
- float alphanum;
- //Is it valid?
- if (opened) {
- if (tintr > 1)tintr = 1;
- if (tintg > 1)tintg = 1;
- if (tintb > 1)tintb = 1;
-
- if (tintr < 0)tintr = 0;
- if (tintg < 0)tintg = 0;
- if (tintb < 0)tintb = 0;
-
- int bytesPerPixel = texture.bpp / 8;
-
- int tempnum = 0;
- alphanum = 255;
- for (int i = 0; i < (int)(texture.sizeY * texture.sizeX * bytesPerPixel); i++) {
- if (bytesPerPixel == 3)alphanum = 255;
- else if ((i + 1) % 4 == 0)alphanum = texture.data[i];
- //alphanum/=2;
- if ((i + 1) % 4 || bytesPerPixel == 3) {
- if ((i % 4) == 0)texture.data[i] *= tintr;
- if ((i % 4) == 1)texture.data[i] *= tintg;
- if ((i % 4) == 2)texture.data[i] *= tintb;
- array[tempnum] = (float)array[tempnum] * (1 - alphanum / 255) + (float)texture.data[i] * (alphanum / 255);
- tempnum++;
- }
- }
- } else return 0;
- return 1;
-}
-
-
-
-static void ch_quit(const char *args)
-{
- tryquit = 1;
-}
-
-static void ch_map(const char *args)
-{
- Loadlevel(args);
- whichlevel = -2;
- campaign = 0;
-}
-
-static void ch_save(const char *args)
-{
- char buf[64];
- snprintf(buf, 63, ":Data:Maps:%s", args);
-
- int mapvers = 12;
-
- FILE *tfile;
- tfile = fopen( ConvertFileName(buf), "wb" );
- fpackf(tfile, "Bi", mapvers);
- fpackf(tfile, "Bi", maptype);
- fpackf(tfile, "Bi", hostile);
- fpackf(tfile, "Bf Bf", viewdistance, fadestart);
- fpackf(tfile, "Bb Bf Bf Bf", skyboxtexture, skyboxr, skyboxg, skyboxb);
- fpackf(tfile, "Bf Bf Bf", skyboxlightr, skyboxlightg, skyboxlightb);
- fpackf(tfile, "Bf Bf Bf Bf Bf Bi", player[0].coords.x, player[0].coords.y, player[0].coords.z,
- player[0].yaw, player[0].targetyaw, player[0].num_weapons);
- if (player[0].num_weapons > 0 && player[0].num_weapons < 5)
- for (int j = 0; j < player[0].num_weapons; j++)
- fpackf(tfile, "Bi", weapons[player[0].weaponids[j]].getType());
-
- fpackf(tfile, "Bf Bf Bf", player[0].armorhead, player[0].armorhigh, player[0].armorlow);
- fpackf(tfile, "Bf Bf Bf", player[0].protectionhead, player[0].protectionhigh, player[0].protectionlow);
- fpackf(tfile, "Bf Bf Bf", player[0].metalhead, player[0].metalhigh, player[0].metallow);
- fpackf(tfile, "Bf Bf", player[0].power, player[0].speedmult);
-
- fpackf(tfile, "Bi", player[0].numclothes);
-
- fpackf(tfile, "Bi Bi", player[0].whichskin, player[0].creature);
-
- fpackf(tfile, "Bi", numdialogues);
-
- for (int k = 0; k < numdialogues; k++) {
- fpackf(tfile, "Bi", numdialogueboxes[k]);
- fpackf(tfile, "Bi", dialoguetype[k]);
- for (int l = 0; l < 10; l++) {
- fpackf(tfile, "Bf Bf Bf", participantlocation[k][l].x, participantlocation[k][l].y, participantlocation[k][l].z);
- fpackf(tfile, "Bf", participantyaw[k][l]);
- }
- for (int l = 0; l < numdialogueboxes[k]; l++) {
- fpackf(tfile, "Bi", dialogueboxlocation[k][l]);
- fpackf(tfile, "Bf", dialogueboxcolor[k][l][0]);
- fpackf(tfile, "Bf", dialogueboxcolor[k][l][1]);
- fpackf(tfile, "Bf", dialogueboxcolor[k][l][2]);
- fpackf(tfile, "Bi", dialogueboxsound[k][l]);
-
- int templength = strlen(dialoguetext[k][l]);
- fpackf(tfile, "Bi", (templength));
- for (int m = 0; m < templength; m++) {
- fpackf(tfile, "Bb", dialoguetext[k][l][m]);
- if (dialoguetext[k][l][m] == '\0')
- break;
- }
-
- templength = strlen(dialoguename[k][l]);
- fpackf(tfile, "Bi", templength);
- for (int m = 0; m < templength; m++) {
- fpackf(tfile, "Bb", dialoguename[k][l][m]);
- if (dialoguename[k][l][m] == '\0')
- break;
- }
-
- fpackf(tfile, "Bf Bf Bf", dialoguecamera[k][l].x, dialoguecamera[k][l].y, dialoguecamera[k][l].z);
- fpackf(tfile, "Bi", participantfocus[k][l]);
- fpackf(tfile, "Bi", participantaction[k][l]);
-
- for (int m = 0; m < 10; m++)
- fpackf(tfile, "Bf Bf Bf", participantfacing[k][l][m].x, participantfacing[k][l][m].y, participantfacing[k][l][m].z);
-
- fpackf(tfile, "Bf Bf", dialoguecamerayaw[k][l], dialoguecamerapitch[k][l]);
- }
- }
-
- for (int k = 0; k < player[0].numclothes; k++) {
- int templength = strlen(player[0].clothes[k]);
- fpackf(tfile, "Bi", templength);
- for (int l = 0; l < templength; l++)
- fpackf(tfile, "Bb", player[0].clothes[k][l]);
- fpackf(tfile, "Bf Bf Bf", player[0].clothestintr[k], player[0].clothestintg[k], player[0].clothestintb[k]);
- }
-
- fpackf(tfile, "Bi", environment);
-
- fpackf(tfile, "Bi", objects.numobjects);
-
- for (int k = 0; k < objects.numobjects; k++)
- fpackf(tfile, "Bi Bf Bf Bf Bf Bf Bf", objects.type[k], objects.yaw[k], objects.pitch[k],
- objects.position[k].x, objects.position[k].y, objects.position[k].z, objects.scale[k]);
-
- fpackf(tfile, "Bi", numhotspots);
- for (int i = 0; i < numhotspots; i++) {
- fpackf(tfile, "Bi Bf Bf Bf Bf", hotspottype[i], hotspotsize[i], hotspot[i].x, hotspot[i].y, hotspot[i].z);
- int templength = strlen(hotspottext[i]);
- fpackf(tfile, "Bi", templength);
- for (int l = 0; l < templength; l++)
- fpackf(tfile, "Bb", hotspottext[i][l]);
- }
-
- fpackf(tfile, "Bi", numplayers);
- if (numplayers < maxplayers)
- for (int j = 1; j < numplayers; j++) {
- fpackf(tfile, "Bi Bi Bf Bf Bf Bi Bi Bf Bb Bf", player[j].whichskin, player[j].creature,
- player[j].coords.x, player[j].coords.y, player[j].coords.z,
- player[j].num_weapons, player[j].howactive, player[j].scale, player[j].immobile, player[j].yaw);
- if (player[j].num_weapons < 5)
- for (int k = 0; k < player[j].num_weapons; k++)
- fpackf(tfile, "Bi", weapons[player[j].weaponids[k]].getType());
- if (player[j].numwaypoints < 30) {
- fpackf(tfile, "Bi", player[j].numwaypoints);
- for (int k = 0; k < player[j].numwaypoints; k++) {
- fpackf(tfile, "Bf", player[j].waypoints[k].x);
- fpackf(tfile, "Bf", player[j].waypoints[k].y);
- fpackf(tfile, "Bf", player[j].waypoints[k].z);
- fpackf(tfile, "Bi", player[j].waypointtype[k]);
- }
- fpackf(tfile, "Bi", player[j].waypoint);
- } else {
- player[j].numwaypoints = 0;
- player[j].waypoint = 0;
- fpackf(tfile, "Bi Bi Bi", player[j].numwaypoints, player[j].waypoint, player[j].waypoint);
- }
-
- fpackf(tfile, "Bf Bf Bf", player[j].armorhead, player[j].armorhigh, player[j].armorlow);
- fpackf(tfile, "Bf Bf Bf", player[j].protectionhead, player[j].protectionhigh, player[j].protectionlow);
- fpackf(tfile, "Bf Bf Bf", player[j].metalhead, player[j].metalhigh, player[j].metallow);
- fpackf(tfile, "Bf Bf", player[j].power, player[j].speedmult);
-
- float headprop, bodyprop, armprop, legprop;
- if (player[j].creature == wolftype) {
- headprop = player[j].proportionhead.x / 1.1;
- bodyprop = player[j].proportionbody.x / 1.1;
- armprop = player[j].proportionarms.x / 1.1;
- legprop = player[j].proportionlegs.x / 1.1;
- } else if (player[j].creature == rabbittype) {
- headprop = player[j].proportionhead.x / 1.2;
- bodyprop = player[j].proportionbody.x / 1.05;
- armprop = player[j].proportionarms.x / 1.00;
- legprop = player[j].proportionlegs.x / 1.1;
- }
-
- fpackf(tfile, "Bf Bf Bf Bf", headprop, bodyprop, armprop, legprop);
-
- fpackf(tfile, "Bi", player[j].numclothes);
- if (player[j].numclothes)
- for (int k = 0; k < player[j].numclothes; k++) {
- int templength;
- templength = strlen(player[j].clothes[k]);
- fpackf(tfile, "Bi", templength);
- for (int l = 0; l < templength; l++)
- fpackf(tfile, "Bb", player[j].clothes[k][l]);
- fpackf(tfile, "Bf Bf Bf", player[j].clothestintr[k], player[j].clothestintg[k], player[j].clothestintb[k]);
- }
- }
-
- fpackf(tfile, "Bi", numpathpoints);
- for (int j = 0; j < numpathpoints; j++) {
- fpackf(tfile, "Bf Bf Bf Bi", pathpoint[j].x, pathpoint[j].y, pathpoint[j].z, numpathpointconnect[j]);
- for (int k = 0; k < numpathpointconnect[j]; k++)
- fpackf(tfile, "Bi", pathpointconnect[j][k]);
- }
-
- fpackf(tfile, "Bf Bf Bf Bf", mapcenter.x, mapcenter.y, mapcenter.z, mapradius);
-
- fclose(tfile);
-}
-
-static void ch_cellar(const char *args)
-{
- player[0].skeleton.drawmodel.textureptr.load(":Data:Textures:Furdarko.jpg", 1, &player[0].skeleton.skinText[0], &player[0].skeleton.skinsize);
-}
-
-static void ch_tint(const char *args)
-{
- sscanf(args, "%f%f%f", &tintr, &tintg, &tintb);
-}
-
-static void ch_tintr(const char *args)
-{
- tintr = atof(args);
-}
-
-static void ch_tintg(const char *args)
-{
- tintg = atof(args);
-}
-
-static void ch_tintb(const char *args)
-{
- tintb = atof(args);
-}
-
-static void ch_speed(const char *args)
-{
- player[0].speedmult = atof(args);
-}
-
-static void ch_strength(const char *args)
-{
- player[0].power = atof(args);
-}
-
-static void ch_power(const char *args)
-{
- player[0].power = atof(args);
-}
-
-static void ch_size(const char *args)
-{
- player[0].scale = atof(args) * .2;
-}
-
-static int findClosestPlayer()
-{
- int closest = -1;
- float closestdist = std::numeric_limits<float>::max();
-
- for (int i = 1; i < numplayers; i++) {
- float distance = distsq(&player[i].coords, &player[0].coords);
- if (distance < closestdist) {
- closestdist = distance;
- closest = i;
- }
- }
- return closest;
-}
-
-static int findClosestObject()
-{
- int closest = -1;
- float closestdist = std::numeric_limits<float>::max();
-
- for (int i = 0; i < objects.numobjects; i++) {
- float distance = distsq(&objects.position[i], &player[0].coords);
- if (distance < closestdist) {
- closestdist = distance;
- closest = i;
- }
- }
- return closest;
-}
-
-static void ch_sizenear(const char *args)
-{
- int closest = findClosestPlayer();
- if (closest >= 0)
- player[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 (player[pnum].creature == wolftype) {
- player[pnum].proportionhead = 1.1 * headprop;
- player[pnum].proportionbody = 1.1 * bodyprop;
- player[pnum].proportionarms = 1.1 * armprop;
- player[pnum].proportionlegs = 1.1 * legprop;
- } else if (player[pnum].creature == rabbittype) {
- player[pnum].proportionhead = 1.2 * headprop;
- player[pnum].proportionbody = 1.05 * bodyprop;
- player[pnum].proportionarms = 1.00 * armprop;
- player[pnum].proportionlegs = 1.1 * legprop;
- player[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);
-
- player[pnum].protectionhead = head;
- player[pnum].protectionhigh = high;
- player[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);
-
- player[pnum].armorhead = head;
- player[pnum].armorhigh = high;
- player[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);
-
- player[pnum].metalhead = head;
- player[pnum].metalhigh = high;
- player[pnum].metallow = low;
-}
-
-static void ch_metal(const char *args)
-{
- set_metal(0, args);
-}
-
-static void set_noclothes(int pnum, const char *args)
-{
- player[pnum].numclothes = 0;
- player[pnum].skeleton.drawmodel.textureptr.load(
- creatureskin[player[pnum].creature][player[pnum].whichskin], 1,
- &player[pnum].skeleton.skinText[0], &player[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, &player[pnum].skeleton.skinText[pnum]))
- return;
-
- player[pnum].DoMipmaps();
- strcpy(player[pnum].clothes[player[pnum].numclothes], buf);
- player[pnum].clothestintr[player[pnum].numclothes] = tintr;
- player[pnum].clothestintg[player[pnum].numclothes] = tintg;
- player[pnum].clothestintb[player[pnum].numclothes] = tintb;
- player[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)
-{
- player[0].skeleton.clothes = !player[0].skeleton.clothes;
-}
-
-
-static void ch_cellophane(const char *args)
-{
- cellophane = !cellophane;
- float mul = cellophane ? 0 : 1;
-
- for (int i = 0; i < numplayers; i++) {
- player[i].proportionhead.z = player[i].proportionhead.x * mul;
- player[i].proportionbody.z = player[i].proportionbody.x * mul;
- player[i].proportionarms.z = player[i].proportionarms.x * mul;
- player[i].proportionlegs.z = player[i].proportionlegs.x * mul;
- }
-}
-
-static void ch_funnybunny(const char *args)
-{
- player[0].skeleton.id = 0;
- player[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);
- player[0].skeleton.drawmodel.textureptr.load(":Data:Textures:fur3.jpg", 1, &player[0].skeleton.skinText[0], &player[0].skeleton.skinsize);
- player[0].creature = rabbittype;
- player[0].scale = .2;
- player[0].headless = 0;
- player[0].damagetolerance = 200;
- set_proportion(0, "1 1 1 1");
-}
-
-static void ch_wolfie(const char *args)
-{
- player[0].skeleton.id = 0;
- player[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);
- player[0].skeleton.drawmodel.textureptr.load(":Data:Textures:Wolf.jpg", 1, &player[0].skeleton.skinText[0], &player[0].skeleton.skinsize);
- player[0].creature = wolftype;
- player[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)
-{
- player[0].skeleton.drawmodel.textureptr.load(":Data:Textures:Wolf.jpg", 1, &player[0].skeleton.skinText[0], &player[0].skeleton.skinsize);
-}
-
-static void ch_snowwolf(const char *args)
-{
- player[0].skeleton.drawmodel.textureptr.load(":Data:Textures:SnowWolf.jpg", 1, &player[0].skeleton.skinText[0], &player[0].skeleton.skinsize);
-}
-
-static void ch_darkwolf(const char *args)
-{
- player[0].skeleton.drawmodel.textureptr.load(":Data:Textures:DarkWolf.jpg", 1, &player[0].skeleton.skinText[0], &player[0].skeleton.skinsize);
-}
-
-static void ch_lizardwolf(const char *args)
-{
- player[0].skeleton.drawmodel.textureptr.load(":Data:Textures:Lizardwolf.jpg", 1, &player[0].skeleton.skinText[0], &player[0].skeleton.skinsize);
-}
-
-static void ch_white(const char *args)
-{
- player[0].skeleton.drawmodel.textureptr.load(":Data:Textures:fur.jpg", 1, &player[0].skeleton.skinText[0], &player[0].skeleton.skinsize);
-}
-
-static void ch_brown(const char *args)
-{
- player[0].skeleton.drawmodel.textureptr.load(":Data:Textures:fur3.jpg", 1, &player[0].skeleton.skinText[0], &player[0].skeleton.skinsize);
-}
-
-static void ch_black(const char *args)
-{
- player[0].skeleton.drawmodel.textureptr.load(":Data:Textures:fur2.jpg", 1, &player[0].skeleton.skinText[0], &player[0].skeleton.skinsize);
-}
-
-static void ch_sizemin(const char *args)
-{
- for (int i = 1; i < numplayers; i++)
- if (player[i].scale < 0.8 * 0.2)
- player[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] = player[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] = player[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 (int j = 0; j < numplayers; j++) {
- participantfacing[numdialogues][i][j] = player[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]] = player[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)
-{
- player[0].immobile = 1;