source: Daodan/src/Daodan_Character.c@ 681

Last change on this file since 681 was 677, checked in by alloc, 12 years ago

Daodan: Updated src to work with MinGW

File size: 2.2 KB
RevLine 
[427]1#include <stdlib.h>
[428]2#include "Daodan_Character.h"
[427]3#include "Oni_Character.h"
[446]4#include "BFW_Utility.h"
5#include "Oni.h"
[427]6
[428]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.....
[427]18}
19
[446]20uint32_t DDrGetCharacterIndexFromName(char* input) {
21 int i;
[677]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++) {
[446]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}
[468]32/*
[446]33OniRectangle TestRect;
[428]34void CHARTest()
35{
[446]36
[433]37 CharacterObject* TestCHAR = malloc(sizeof(CharacterObject));
38 memset(TestCHAR, 0, sizeof(CharacterObject));
[428]39
[433]40 int type = 0x43484152;
41 TestCHAR->Header.Type = type;
42 memcpy(TestCHAR->OSD.Name, "Gumby", 6);
[434]43 memcpy(TestCHAR->OSD.Class, "striker_easy_1", 15);
[446]44 memcpy(TestCHAR->OSD.ScriptSpawn, "dmsg", 20);
45 //TestCHAR->OSD.Options = chr_unkillable;
[433]46 TestCHAR->OSD.TeamID = team_syndicate;
[446]47 //int* ptr = 0x005ECE70;
48 TestRect.Top = 10;
49 TestRect.Left = 10;
50 TestRect.Right = 100;
51 TestRect.Bottom = 100;
[428]52
[446]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;
[428]59}
[468]60*/
Note: See TracBrowser for help on using the repository browser.