source: Daodan/MSVC/Daodan_Character.c@ 607

Last change on this file since 607 was 567, checked in by gumby, 14 years ago

Daodan MSVC

File size: 2.2 KB
RevLine 
[567]1#include <stdlib.h>
2#include "Daodan_Character.h"
3#include "Oni_Character.h"
4#include "BFW_Utility.h"
5#include "Oni.h"
6
7int DDr_TeamToTeamID(const char* team_string) //Already something like this in the engine, but I'm reimplementing it...
8{
9 if (!strcmp(team_string, "Konoko")) return team_konoko;
10 else if (!strcmp(team_string, "TCTF")) return team_tctf;
11 else if (!strcmp(team_string, "Syndicate")) return team_syndicate;
12 else if (!strcmp(team_string, "Neutral")) return team_neutral;
13 else if (!strcmp(team_string, "SecurityGuard")) return team_securityguard;
14 else if (!strcmp(team_string, "RougeKonoko")) return team_rougekonoko;
15 else if (!strcmp(team_string, "Switzerland")) return team_switzerland;
16 else if (!strcmp(team_string, "SyndicateAccessory")) return team_syndicateaccessory;
17 return team_neutral; //if you enter a bad teamname, return Neutral.....
18}
19
20uint32_t DDrGetCharacterIndexFromName(char* input) {
21 int i;
22 Character **characterlist = ONgGameState->PresentCharacterList; //pointer to array of Character pointers
23 int total_characters = ONgGameState->PresentCharacterListCount; //Max number of characters
24 for(i = 0; i < total_characters; i++) {
25 if (characterlist[i] != 0) //anti Blam!
26 if (!strcmp(characterlist[i]->Name, input)) { //checks for the same name
27 return characterlist[i]->Number;
28 }
29 }
30return -1; //not found :(
31}
32/*
33OniRectangle TestRect;
34void CHARTest()
35{
36
37 CharacterObject* TestCHAR = malloc(sizeof(CharacterObject));
38 memset(TestCHAR, 0, sizeof(CharacterObject));
39
40 int type = 0x43484152;
41 TestCHAR->Header.Type = type;
42 memcpy(TestCHAR->OSD.Name, "Gumby", 6);
43 memcpy(TestCHAR->OSD.Class, "striker_easy_1", 15);
44 memcpy(TestCHAR->OSD.ScriptSpawn, "dmsg", 20);
45 //TestCHAR->OSD.Options = chr_unkillable;
46 TestCHAR->OSD.TeamID = team_syndicate;
47 //int* ptr = 0x005ECE70;
48 TestRect.Top = 10;
49 TestRect.Left = 10;
50 TestRect.Right = 100;
51 TestRect.Bottom = 100;
52
53 char str[5] = "hi";
54 str[2] = '\0';
55 AUrMessageBox(0, "%8x", &TestRect);
56 int16_t a = TSrContext_DrawText(TestContext, str, 0xFF, &TestRect, &TestRect);
57 //ONrGameState_NewCharacter(TestCHAR, NULL, NULL, NULL);
58 return;
59}
60*/
Note: See TracBrowser for help on using the repository browser.