You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(136) |
Dec
(218) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(214) |
Feb
(208) |
Mar
(186) |
Apr
(15) |
May
(3) |
Jun
(35) |
Jul
(6) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(58) |
Aug
(123) |
Sep
(31) |
Oct
(9) |
Nov
|
Dec
(1) |
2006 |
Jan
(25) |
Feb
(10) |
Mar
(25) |
Apr
(61) |
May
|
Jun
(78) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Update of /cvsroot/timewarp/source/twgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25475 Modified Files: gamebuttonevent.h gametest2.cpp twbutton.cpp twbutton.h twbuttontypes.cpp twbuttontypes.h twhelpers.cpp twhelpers.h twmenuexamples.cpp twmenuexamples.h twpopup.cpp twpopup.h twwindow.cpp twwindow.h utils.cpp utils.h Added Files: twguilist.cpp twguilist.h Removed Files: twgui.cpp twgui.h twgui.txt twgui_infot.txt Log Message: made twgui independent of other timewarp code --- NEW FILE: twguilist.cpp --- /* Placed in public domain by Rob Devilee, 2004. Share and enjoy! */ #include <allegro.h> #ifndef LINUX #include <winalleg.h> #endif #include <stdio.h> #include <string.h> #include "twgui.h" #include "twwindow.h" // ------------ AND NOW THE GRAPHICAL PART --------------- [...1045 lines suppressed...] selected = true; } int MatrixIcons::getk() { int k; k = scroll.xselect + scroll.yselect * Nx; if ( k > maxitems-1 ) k = maxitems-1; return k; } --- NEW FILE: twguilist.h --- /* Placed in public domain by Rob Devilee, 2004. Share and enjoy! */ #ifndef __TWGUI_LIST_H__ #define __TWGUI_LIST_H__ #include "twwindow.h" #include "twbuttontypes.h" #include "twhelpers.h" // something which has a background, and its own drawing-area class AreaTabletScrolled : public AreaTablet { protected: //scrollpos_str scroll; ScrollControl scroll; public: AreaTabletScrolled(TWindow *menu, char *identbranch, int asciicode, bool akeepkey = 0); int gety(); virtual void calculate(); }; // a text on top of a button. // no interaction with environment, it's purely a message. class TextButton : public AreaTablet { public: TextButton(TWindow *menu, char *identbranch, FONT *afont); virtual ~TextButton(); FONT *usefont; char *text; int text_color; virtual void subanimate(); void set_text(char *txt, int color); }; // Draws a list of text strings onto a background // Returns the "item" (or line) number that's selected // This must support a scroll-bar, in case the list does not fit in the box class TextList : public AreaTabletScrolled { int Nreserved; public: TextList(TWindow *menu, char *identbranch, FONT *afont); ~TextList(); //ScrollControl scroll; char **optionlist; int N; // number of options FONT *usefont; int Htxt, Nshow; //int yselected; // the selected item. void clear_optionlist(); void set_optionlist(char **aoptionlist, int color); // overwrite a list. void set_optionlist(char **aoptionlist, int aN, int color); void add_optionlist(char *newstr); // add one item to an existing list. void set_selected(int iy); int text_color; void initbackgr(bool autoplace); virtual void subanimate(); virtual void handle_lpress(); virtual void handle_rpress(); virtual void calculate(); int getk(); }; // Draw some text into a box... text can consist of many lines. No editing possible. // If there's a lot of text, you could scroll. class TextInfoArea : public AreaTabletScrolled { protected: int maxchars; // you can't add chars beyond that char *localcopy; TextInfo *textinfo; //scrollpos_str *scroll; public: TextInfoArea(TWindow *menu, char *identbranch, FONT *afont, char *atext, int amaxtext); virtual ~TextInfoArea(); int linestart[maxlines]; int Nlines; FONT *usefont; //int Htxt, Nshow; int text_color; void set_textinfo(char *atextinfo); void set_textinfo(char *atextinfo, int Nchars); void set_textinfo_unbuffered(char *newtext, int Nchars); virtual void subanimate(); }; class TextEditBox : public TextInfoArea { protected: int charpos; // this is used to record when the last key-press was made (with a resolution // of 1 frame at best). bool keypr[KEY_MAX]; int lastpressed; int repeattime, lasttime; public: char *text;//[128]; // can hold 1 line of text. int text_color; TextEditBox(TWindow *menu, char *identbranch, FONT *afont, char *atext, int amaxtext); virtual ~TextEditBox(); virtual void calculate(); virtual void subanimate(); virtual void handle_lpress(); // void clear_text(); // void show_text(); // set the typematic delay to "atime" milliseconds (default = 100) //void set_repeattime(int atime); void set_textcolor(int c); void text_reset(); void text_reset(char *newtext, int N); char *get_text(); }; // implement a matrix of icons // the box defines the area where the icons are visible; class MatrixIcons : public AreaTabletScrolled { protected: int Nx, Ny, Nxshow, Nyshow, maxitems; int Wicon, Hicon; BITMAP *overlay, *tmp; double extrascale; public: enum property {ENABLE=0x01, DISABLE=0x02}; // int xselect, yselect; // int xold, yold; bool selected; int *itemproperty; BITMAP **listIcon; MatrixIcons(TWindow *menu, char *identbranch, int akey); virtual ~MatrixIcons(); void set_iconinfo(BITMAP **alistIcon, double ascale); int getk(); virtual void subanimate(); virtual void subcalculate(); virtual void handle_lpress(); virtual void handle_rpress(); // for scrolling //virtual void handle_doubleclick(); }; #endif // __TWGUI_GUI_H__ Index: gamebuttonevent.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/gamebuttonevent.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gamebuttonevent.h 22 Feb 2004 10:49:37 -0000 1.4 --- gamebuttonevent.h 28 Feb 2004 15:16:32 -0000 1.5 *************** *** 1,2 **** --- 1,5 ---- + /* + Placed in public domain by Rob Devilee, 2004. Share and enjoy! + */ #ifndef __GAMEBUTTONEVENT_H__ Index: gametest2.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/gametest2.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gametest2.cpp 19 Feb 2004 01:12:19 -0000 1.6 --- gametest2.cpp 28 Feb 2004 15:16:32 -0000 1.7 *************** *** 1,4 **** - #include <allegro.h> //#include <winalleg.h> --- 1,3 ---- *************** *** 39,42 **** --- 38,43 ---- #include "gamebuttonevent.h" + #include "../other/configrw.h" + /* *************** *** 111,119 **** // create the cache/ directory (if needed ?) ! #ifdef LINUX mkdir("cache", 0755); #else mkdir("cache"); ! #endif --- 112,121 ---- // create the cache/ directory (if needed ?) ! /*#ifdef LINUX mkdir("cache", 0755); #else mkdir("cache"); ! #endif*/ ! makedir("cache"); Index: twbutton.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twbutton.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** twbutton.cpp 15 Feb 2004 13:08:57 -0000 1.6 --- twbutton.cpp 28 Feb 2004 15:16:32 -0000 1.7 *************** *** 1,2 **** --- 1,5 ---- + /* + Placed in public domain by Rob Devilee, 2004. Share and enjoy! + */ *************** *** 4,13 **** #include <stdio.h> #include <string.h> ! ! ! #include "../melee.h" ! //#include "melee/mview.h" ! ! REGISTER_FILE #include "twbutton.h" --- 7,11 ---- #include <stdio.h> #include <string.h> ! #include <math.h> #include "twbutton.h" *************** *** 417,421 **** int D = 4; // width of the rectangle ! D *= iround(mainwindow->scale - 1); if (D < 0) D = 0; --- 415,419 ---- int D = 4; // width of the rectangle ! D *= round(mainwindow->scale - 1); if (D < 0) D = 0; *************** *** 434,440 **** unsigned char r, g, b; ! r = (unsigned char)(128 + 127 * sin(phase + PI2 * L/Ltot)); ! g = (unsigned char)(128 + 127 * sin(phase + 0.3*PI + PI2 * L/Ltot)); ! b = (unsigned char)(128 + 127 * sin(phase + 0.7*PI + PI2 * L/Ltot)); return makecol(r, g, b); --- 432,438 ---- unsigned char r, g, b; ! r = (unsigned char)(128 + 127 * sin(phase + 2*AL_PI * L/Ltot)); ! g = (unsigned char)(128 + 127 * sin(phase + 0.3*AL_PI + 2*AL_PI * L/Ltot)); ! b = (unsigned char)(128 + 127 * sin(phase + 0.7*AL_PI + 2*AL_PI * L/Ltot)); return makecol(r, g, b); *************** *** 454,458 **** int D = 2; // width of the rectangle ! D = iround(D * mainwindow->scale) - 1; // cause 0 also counts as 1... if (D < 0) D = 0; --- 452,456 ---- int D = 2; // width of the rectangle ! D = round(D * mainwindow->scale) - 1; // cause 0 also counts as 1... if (D < 0) D = 0; *************** *** 461,465 **** ! double phase = mainwindow->menu_time * 1E-3 * PI; //offset angle int L; --- 459,463 ---- ! double phase = mainwindow->menu_time * 1E-3 * AL_PI; //offset angle int L; *************** *** 518,526 **** int i, j; int W = 2; ! W = iround(W * mainwindow->scale) - 1; int L = 0; int Ltotal = 5 * sqrt( (double)bmpref->w * bmpref->h ); ! double phase = mainwindow->menu_time * 1E-3 * PI; //offset angle for ( j = -W; j < bmpref->h + W; ++j ) --- 516,524 ---- int i, j; int W = 2; ! W = round(W * mainwindow->scale) - 1; int L = 0; int Ltotal = 5 * sqrt( (double)bmpref->w * bmpref->h ); ! double phase = mainwindow->menu_time * 1E-3 * AL_PI; //offset angle for ( j = -W; j < bmpref->h + W; ++j ) *************** *** 575,579 **** if (!tmp) { ! tw_error("Could not find the comparison bmp in the datafile"); } --- 573,577 ---- if (!tmp) { ! twgui_error("Could not find the comparison bmp in the datafile"); } *************** *** 590,594 **** pos.x = get_config_int(0, strx, 0); pos.y = get_config_int(0, stry, 0); ! Vector2 oldpos = pos; k = mainwindow->search_bmp_location(tmp, &pos); --- 588,592 ---- pos.x = get_config_int(0, strx, 0); pos.y = get_config_int(0, stry, 0); ! twguiVector oldpos = pos; k = mainwindow->search_bmp_location(tmp, &pos); *************** *** 606,610 **** if (!k && mainwindow->autoplace) { ! tw_error("Could not find the bmp on the background image"); } } --- 604,608 ---- if (!k && mainwindow->autoplace) { ! twgui_error("Could not find the bmp on the background image"); } } Index: twbutton.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twbutton.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** twbutton.h 22 Feb 2004 10:49:37 -0000 1.4 --- twbutton.h 28 Feb 2004 15:16:32 -0000 1.5 *************** *** 1,2 **** --- 1,5 ---- + /* + Placed in public domain by Rob Devilee, 2004. Share and enjoy! + */ #ifndef __TWBUTTON_H__ *************** *** 34,38 **** public: EmptyButton *prev, *next; ! Vector2 pos, size; // these are used to define the box area (top left corner and dimensions) ButtonEvent *button_event; --- 37,41 ---- public: EmptyButton *prev, *next; ! twguiVector pos, size; // these are used to define the box area (top left corner and dimensions) ButtonEvent *button_event; Index: twbuttontypes.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twbuttontypes.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** twbuttontypes.cpp 15 Feb 2004 13:08:57 -0000 1.7 --- twbuttontypes.cpp 28 Feb 2004 15:16:32 -0000 1.8 *************** *** 1,2 **** --- 1,5 ---- + /* + Placed in public domain by Rob Devilee, 2004. Share and enjoy! + */ #include <allegro.h> *************** *** 4,10 **** #include <string.h> - #include "../melee.h" - #include "../melee/mview.h" - REGISTER_FILE #include "twwindow.h" --- 7,10 ---- *************** *** 374,378 **** // also update the button position to reflect this change ! pbutton = pmin + iround(relpos * (pmax - pmin)); } --- 374,378 ---- // also update the button position to reflect this change ! pbutton = pmin + round(relpos * (pmax - pmin)); } Index: twbuttontypes.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twbuttontypes.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** twbuttontypes.h 22 Feb 2004 10:49:37 -0000 1.8 --- twbuttontypes.h 28 Feb 2004 15:16:32 -0000 1.9 *************** *** 1,2 **** --- 1,5 ---- + /* + Placed in public domain by Rob Devilee, 2004. Share and enjoy! + */ #ifndef __TWBUTTONTYPES_H__ Index: twhelpers.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twhelpers.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** twhelpers.cpp 29 Jan 2004 21:20:31 -0000 1.4 --- twhelpers.cpp 28 Feb 2004 15:16:32 -0000 1.5 *************** *** 1,2 **** --- 1,5 ---- + /* + Placed in public domain by Rob Devilee, 2004. Share and enjoy! + */ *************** *** 6,13 **** - #include "../melee.h" - //#include "melee/mview.h" - - REGISTER_FILE #include "twbutton.h" --- 9,12 ---- *************** *** 132,136 **** void ScrollControl::set_percent_pos_x(double alpha) { ! x = iround( (Nx-1) * alpha ); check_pos(); } --- 131,135 ---- void ScrollControl::set_percent_pos_x(double alpha) { ! x = round( (Nx-1) * alpha ); check_pos(); } *************** *** 138,142 **** void ScrollControl::set_percent_pos_y(double alpha) { ! y = iround( (Ny-1) * alpha ); check_pos(); } --- 137,141 ---- void ScrollControl::set_percent_pos_y(double alpha) { ! y = round( (Ny-1) * alpha ); check_pos(); } *************** *** 518,522 **** if (iline < 0) { ! tw_error("getcharpos : Nlines < 0 should not happen"); } --- 517,521 ---- if (iline < 0) { ! twgui_error("getcharpos : Nlines < 0 should not happen"); } Index: twhelpers.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twhelpers.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** twhelpers.h 22 Feb 2004 10:49:37 -0000 1.4 --- twhelpers.h 28 Feb 2004 15:16:32 -0000 1.5 *************** *** 1,2 **** --- 1,5 ---- + /* + Placed in public domain by Rob Devilee, 2004. Share and enjoy! + */ #ifndef __TWHELPERS_H__ Index: twmenuexamples.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twmenuexamples.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** twmenuexamples.cpp 29 Jan 2004 21:20:31 -0000 1.4 --- twmenuexamples.cpp 28 Feb 2004 15:16:32 -0000 1.5 *************** *** 1,2 **** --- 1,5 ---- + /* + Placed in public domain by Rob Devilee, 2004. Share and enjoy! + */ *************** *** 5,13 **** #include <string.h> - #include "../melee.h" - //#include "melee/mview.h" - REGISTER_FILE #include "twbutton.h" --- 8,14 ---- #include <string.h> + #include <math.h> #include "twbutton.h" Index: twmenuexamples.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twmenuexamples.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** twmenuexamples.h 10 Jan 2004 22:27:59 -0000 1.3 --- twmenuexamples.h 28 Feb 2004 15:16:32 -0000 1.4 *************** *** 1,2 **** --- 1,5 ---- + /* + Placed in public domain by Rob Devilee, 2004. Share and enjoy! + */ #ifndef __TWMENUEXAMPLES_H__ Index: twpopup.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twpopup.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** twpopup.cpp 29 Jan 2004 21:20:31 -0000 1.4 --- twpopup.cpp 28 Feb 2004 15:16:32 -0000 1.5 *************** *** 1,2 **** --- 1,5 ---- + /* + Placed in public domain by Rob Devilee, 2004. Share and enjoy! + */ *************** *** 6,14 **** - #include "../melee.h" - //#include "melee/mview.h" - - REGISTER_FILE - #include "twbutton.h" --- 9,12 ---- *************** *** 184,189 **** init_components(identbranch); ! xshift = iround(axshift * scale); ! yshift = iround(ayshift * scale); } --- 182,187 ---- init_components(identbranch); ! xshift = round(axshift * scale); ! yshift = round(ayshift * scale); } *************** *** 198,203 **** init_components(identbranch); ! xshift = iround(axshift * scale); ! yshift = iround(ayshift * scale); } --- 196,201 ---- init_components(identbranch); ! xshift = round(axshift * scale); ! yshift = round(ayshift * scale); } Index: twpopup.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twpopup.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** twpopup.h 10 Jan 2004 22:27:59 -0000 1.3 --- twpopup.h 28 Feb 2004 15:16:32 -0000 1.4 *************** *** 1,2 **** --- 1,5 ---- + /* + Placed in public domain by Rob Devilee, 2004. Share and enjoy! + */ #ifndef __TWMENUCOMPONENT_H__ Index: twwindow.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twwindow.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** twwindow.cpp 15 Feb 2004 13:08:57 -0000 1.9 --- twwindow.cpp 28 Feb 2004 15:16:32 -0000 1.10 *************** *** 1,2 **** --- 1,5 ---- + /* + Placed in public domain by Rob Devilee, 2004. Share and enjoy! + */ #include <allegro.h> *************** *** 4,13 **** #include <string.h> ! ! #include "../melee.h" ! //#include "melee/mview.h" ! ! REGISTER_FILE ! #include "twwindow.h" --- 7,11 ---- #include <string.h> ! #include "utils.h" #include "twwindow.h" *************** *** 47,51 **** if (!screen) { ! tw_error("Something is wrong with the screen!!"); } --- 45,49 ---- if (!screen) { ! twgui_error("Something is wrong with the screen!!"); } *************** *** 67,71 **** // if (!datafile) // { ! // tw_error("TWindow: Could not load datafile"); // } --- 65,69 ---- // if (!datafile) // { ! // twgui_error("TWindow: Could not load datafile"); // } *************** *** 110,119 **** if (backgr) { ! x = iround(dx * scale); ! y = iround(dy * scale); W = backgr->w; // background is already scaled !! H = backgr->h; } else { ! tw_error("TWindow: No background defined !!"); } --- 108,117 ---- if (backgr) { ! x = round(dx * scale); ! y = round(dy * scale); W = backgr->w; // background is already scaled !! H = backgr->h; } else { ! twgui_error("TWindow: No background defined !!"); } *************** *** 134,138 **** if (is_same_bitmap(backgr, drawarea) || !backgr || !drawarea || !screen) { ! tw_error("oh my!"); } --- 132,136 ---- if (is_same_bitmap(backgr, drawarea) || !backgr || !drawarea || !screen) { ! twgui_error("oh my!"); } *************** *** 146,150 **** // clear_keys(); ! menu_starttime = get_time(); menu_time = menu_starttime; --- 144,148 ---- // clear_keys(); ! menu_starttime = twgui_time(); menu_time = menu_starttime; *************** *** 383,387 **** if (strlen(ident) > 120) { ! tw_error("string exceeds max length"); } --- 381,385 ---- if (strlen(ident) > 120) { ! twgui_error("string exceeds max length"); } *************** *** 419,424 **** // move ! x = iround(xcenter*scale) - W / 2; ! y = iround(ycenter*scale) - H / 2; // read the new background --- 417,422 ---- // move ! x = round(xcenter*scale) - W / 2; ! y = round(ycenter*scale) - H / 2; // read the new background *************** *** 768,779 **** void TWindow::scalepos(int *ax, int *ay) { ! (*ax) = iround( (*ax) * scale ); ! (*ay) = iround( (*ay) * scale ); } ! void TWindow::scalepos(Vector2 *apos) { ! (apos->x) = iround( (apos->x) * scale ); ! (apos->y) = iround( (apos->y) * scale ); } --- 766,777 ---- void TWindow::scalepos(int *ax, int *ay) { ! (*ax) = round( (*ax) * scale ); ! (*ay) = round( (*ay) * scale ); } ! void TWindow::scalepos(twguiVector *apos) { ! (apos->x) = round( (apos->x) * scale ); ! (apos->y) = round( (apos->y) * scale ); } *************** *** 821,825 **** ! bool TWindow::search_bmp_location(BITMAP *bmp_default, Vector2 *apos) { ASSERT(bmp_default); --- 819,823 ---- ! bool TWindow::search_bmp_location(BITMAP *bmp_default, twguiVector *apos) { ASSERT(bmp_default); *************** *** 909,913 **** void TWindow::update_time() { ! menu_time = get_time() - menu_starttime; } --- 907,911 ---- void TWindow::update_time() { ! menu_time = twgui_time() - menu_starttime; } Index: twwindow.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twwindow.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** twwindow.h 10 Jan 2004 22:27:59 -0000 1.6 --- twwindow.h 28 Feb 2004 15:16:32 -0000 1.7 *************** *** 1,2 **** --- 1,5 ---- + /* + Placed in public domain by Rob Devilee, 2004. Share and enjoy! + */ #ifndef __TWWINDOW_H__ *************** *** 90,94 **** bool checkmouse(); bool grabbedmouse; ! Vector2 mpos; --- 93,97 ---- bool checkmouse(); bool grabbedmouse; ! twguiVector mpos; *************** *** 141,148 **** void scalepos(int *ax, int *ay); ! void scalepos(Vector2 *apos); char configfilename[256]; ! bool search_bmp_location(BITMAP *bmp_default, Vector2 *apos); bool exclusive; --- 144,151 ---- void scalepos(int *ax, int *ay); ! void scalepos(twguiVector *apos); char configfilename[256]; ! bool search_bmp_location(BITMAP *bmp_default, twguiVector *apos); bool exclusive; Index: utils.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/utils.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** utils.cpp 29 Jan 2004 21:20:31 -0000 1.10 --- utils.cpp 28 Feb 2004 15:16:32 -0000 1.11 *************** *** 1,2 **** --- 1,5 ---- + /* + Placed in public domain by Rob Devilee, 2004. Share and enjoy! + */ #include <allegro.h> *************** *** 4,9 **** #include <string.h> - #include "../melee.h" - #include "utils.h" //#include "area.h" --- 7,10 ---- *************** *** 16,19 **** --- 17,53 ---- TKeyHandler keyhandler; + // dummy to prevent possible crash + static void error_handler_dummy(const char *txt, ...) + { + } + + // dummy to prevent possible crash + static volatile int twgui_timer_dummy() + { + return 0; + } + + + twgui_err_handler_type *twgui_error = error_handler_dummy; + + twgui_time_handler_type *twgui_time = twgui_timer_dummy; + + + void twgui_init(twgui_time_handler_type t, twgui_err_handler_type f) + { + twgui_time = t; + twgui_error = f; + } + + + + int round(double x) + { + if (x > 0) + return int(x + 0.5); + else + return int(x - 0.5); + } + *************** *** 56,60 **** if (strlen(identif) > 120) { ! tw_error("string exceeds max length"); } --- 90,94 ---- if (strlen(identif) > 120) { ! twgui_error("string exceeds max length"); } *************** *** 68,72 **** //char txt[512]; //sprintf(txt, "Could not find %s", objname); ! //tw_error(txt); return 0; } --- 102,106 ---- //char txt[512]; //sprintf(txt, "Could not find %s", objname); ! //twgui_error(txt); return 0; } *************** *** 88,93 **** int W, H; ! W = iround( src->w * scale ); ! H = iround( src->h * scale ); dest = create_bitmap_ex(bpp, W, H); --- 122,127 ---- int W, H; ! W = round( src->w * scale ); ! H = round( src->h * scale ); dest = create_bitmap_ex(bpp, W, H); *************** *** 196,202 **** int b = mouse_b; ! left.update(bool(b & 1)); // make distinction here; individual buttons shouldn't know of each other ! mid.update(bool(b & 4)); ! right.update(bool(b & 2)); } --- 230,236 ---- int b = mouse_b; ! left.update((b & 1) != 0); // make distinction here; individual buttons shouldn't know of each other ! mid.update((b & 4) != 0); ! right.update((b & 2) != 0); } *************** *** 212,216 **** if (button.status != oldbutton.status) ! button.time = get_time2() * 1E-3; // detect timing of a change in button status button.change = true; --- 246,250 ---- if (button.status != oldbutton.status) ! button.time = twgui_time() * 1E-3; // detect timing of a change in button status button.change = true; Index: utils.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/utils.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** utils.h 10 Jan 2004 22:27:59 -0000 1.8 --- utils.h 28 Feb 2004 15:16:32 -0000 1.9 *************** *** 1,6 **** --- 1,27 ---- + /* + Placed in public domain by Rob Devilee, 2004. Share and enjoy! + */ + #ifndef __TWGUI_UTILS_H__ #define __TWGUI_UTILS_H__ + // INTERFACE NECESSARY TO SET UP !! + + // point to a routine that displays error messages + typedef volatile int (twgui_time_handler_type()); + typedef void (twgui_err_handler_type(const char *txt, ...)); + + extern twgui_time_handler_type *twgui_time; + extern twgui_err_handler_type *twgui_error; + + + + void twgui_init(twgui_time_handler_type t, twgui_err_handler_type f); + + int round(double x); + + + int mapkey(int scancode_key, int scancode_ctrl = 0); int unmapkey1(int k); *************** *** 16,19 **** --- 37,66 ---- + + + // copied from timewarp code (Orz). + struct twguiVector + { + double x, y; + twguiVector () {} + twguiVector (double a, double b) : x(a), y(b) {} + twguiVector (void *nothing) : x(0), y(0) {} + twguiVector &operator= (void *nothing) {x = y = 0; return *this;} + twguiVector &operator+=(twguiVector a) { x+=a.x;y+=a.y; return *this;} + twguiVector &operator-=(twguiVector a) { x-=a.x;y-=a.y; return *this;} + twguiVector &operator*=(double a) { x*=a; y*=a; return *this;} + twguiVector &operator/=(double a) { double b = 1/a; x*=b; y*=b; return *this;} + twguiVector operator-() const { return twguiVector(-x,-y); } + bool operator==(twguiVector a) const { return ((x==a.x) && (y==a.y)); } + bool operator!=(twguiVector a) const { return ((x!=a.x) || (y!=a.y)); } + }; + + inline twguiVector operator+ (twguiVector a, twguiVector b) { return twguiVector(a.x+b.x,a.y+b.y); } + inline twguiVector operator- (twguiVector a, twguiVector b) { return twguiVector(a.x-b.x,a.y-b.y); } + inline twguiVector operator* (twguiVector a, double b) { return twguiVector(a.x*b,a.y*b); } + inline twguiVector operator* (double b, twguiVector a) { return twguiVector(a.x*b,a.y*b); } + inline twguiVector operator/ (twguiVector a, double b) { double c = 1/b; return twguiVector(a.x*c,a.y*c); } + + class normalmouse { --- twgui.cpp DELETED --- --- twgui.h DELETED --- --- twgui.txt DELETED --- --- twgui_infot.txt DELETED --- |
From: <yu...@us...> - 2004-02-28 01:15:30
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25721/source/newships Modified Files: _howto_2.cpp shpalhha.cpp shpastba.cpp shpgeror.cpp shpgerra.cpp shpsefn2.cpp Log Message: Added first real GOB quest (youBastrd you have to look :) ) Fixed bug with PrintMessage function Readded icon for MSVC (need to change twwin.dsp to text format) Added debug info for release configuration Timewarp compile with GCC again Index: _howto_2.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/_howto_2.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _howto_2.cpp 26 Feb 2004 22:23:21 -0000 1.1 --- _howto_2.cpp 28 Feb 2004 01:05:48 -0000 1.2 *************** *** 35,39 **** }; ! HowTo_2::activate_weapon() { Missile *m; --- 35,39 ---- }; ! int HowTo_2::activate_weapon() { Missile *m; Index: shpalhha.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpalhha.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpalhha.cpp 26 Feb 2004 21:33:26 -0000 1.1 --- shpalhha.cpp 28 Feb 2004 01:05:48 -0000 1.2 *************** *** 181,191 **** if (fire_special && this->batt - special_drain >= 0) { ! currentSweepTime += frame_time * sweepFactor; ! game->play_sound(data->sampleWeapon[0],this,255,900 + 1500 * (currentSweepTime / specialTime)); } else { ! currentSweepTime -= frame_time * sweepFactor; ! game->play_sound(data->sampleSpecial[0],this,255,900 + 1500 * (currentSweepTime / specialTime)); } /* --- 181,191 ---- if (fire_special && this->batt - special_drain >= 0) { ! currentSweepTime += iround(frame_time * sweepFactor); ! game->play_sound(data->sampleWeapon[0],this,255,900 + iround(1500 * (currentSweepTime / specialTime))); } else { ! currentSweepTime -= iround(frame_time * sweepFactor); ! game->play_sound(data->sampleSpecial[0],this,255,900 + iround(1500 * (currentSweepTime / specialTime))); } /* Index: shpastba.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpastba.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpastba.cpp 26 Feb 2004 21:33:26 -0000 1.1 --- shpastba.cpp 28 Feb 2004 01:05:48 -0000 1.2 *************** *** 420,424 **** { int _old_trans = aa_get_trans(); ! aa_set_trans ( 255 * ((max_health-health) / (max_health + 1)) ); sprite->animate(pos, sprite_index, space); aa_set_trans(_old_trans); --- 420,424 ---- { int _old_trans = aa_get_trans(); ! aa_set_trans ( iround(255 * ((max_health-health) / (max_health + 1))) ); sprite->animate(pos, sprite_index, space); aa_set_trans(_old_trans); *************** *** 430,434 **** int _old_trans = aa_get_trans(); ! aa_set_trans ( 255 * (hurty_time / max_hurt_flash_time)); sprite->animate(pos,sprite_index, space); aa_set_trans(_old_trans); --- 430,434 ---- int _old_trans = aa_get_trans(); ! aa_set_trans ( iround(255 * (hurty_time / max_hurt_flash_time))); sprite->animate(pos,sprite_index, space); aa_set_trans(_old_trans); *************** *** 678,682 **** { int _old_trans = aa_get_trans(); ! aa_set_trans ( 255 * ((max_health-health) / (max_health + 1)) ); sprite->animate(pos, sprite_index, space); aa_set_trans(_old_trans); --- 678,682 ---- { int _old_trans = aa_get_trans(); ! aa_set_trans ( iround(255 * ((max_health-health) / (max_health + 1)) )); sprite->animate(pos, sprite_index, space); aa_set_trans(_old_trans); *************** *** 688,692 **** int _old_trans = aa_get_trans(); ! aa_set_trans ( 255 * (hurty_time / max_hurt_flash_time)); sprite->animate(pos,sprite_index, space); aa_set_trans(_old_trans); --- 688,692 ---- int _old_trans = aa_get_trans(); ! aa_set_trans ( iround(255 * (hurty_time / max_hurt_flash_time))); sprite->animate(pos,sprite_index, space); aa_set_trans(_old_trans); *************** *** 955,959 **** int _old_trans = aa_get_trans(); ! aa_set_trans ( 255 * (hurty_time / max_hurt_flash_time) ); sprite->animate(pos,sprite_index, space); aa_set_trans(_old_trans); --- 955,959 ---- int _old_trans = aa_get_trans(); ! aa_set_trans ( iround(255 * (hurty_time / max_hurt_flash_time) )); sprite->animate(pos,sprite_index, space); aa_set_trans(_old_trans); *************** *** 996,1000 **** add(new BasiliskGas(0.0, 0.0, a, (aimline->target != NULL) ? weaponVelocity*aimBonus : weaponVelocity, ! weaponDamage, weaponLife, weaponRange, weaponArmour, poison, this, data->spriteWeapon, 1.0)); --- 996,1000 ---- add(new BasiliskGas(0.0, 0.0, a, (aimline->target != NULL) ? weaponVelocity*aimBonus : weaponVelocity, ! weaponDamage, weaponLife, weaponRange, iround(weaponArmour), poison, this, data->spriteWeapon, 1.0)); *************** *** 1006,1010 **** //if(!(turn_left || turn_right || !thrust)) { ! double frac = float(numSegs)/float(specialSegs); //double frac2 = numSegs/specialSegs; //double frac2 = magnitude(this->vel)/speed_max; --- 1006,1010 ---- //if(!(turn_left || turn_right || !thrust)) { ! //double frac = float(numSegs)/float(specialSegs); //double frac2 = numSegs/specialSegs; //double frac2 = magnitude(this->vel)/speed_max; *************** *** 1197,1203 **** for (j=3; j>=0; j--) { if (space_zoom <= 1) ! set_trans_blender(0, 0, 0, space_zoom * 255 * t * (4-j) / 4.0); else ! set_trans_blender(0, 0, 0, 1 * 255 * t * (4-j) / 4.0); xi = iround(x0 - dx * j); yi = iround(y0 - dy * j); --- 1197,1203 ---- for (j=3; j>=0; j--) { if (space_zoom <= 1) ! set_trans_blender(0, 0, 0, iround(space_zoom * 255 * t * (4-j) / 4.0)); else ! set_trans_blender(0, 0, 0, iround(1 * 255 * t * (4-j) / 4.0)); xi = iround(x0 - dx * j); yi = iround(y0 - dy * j); *************** *** 1345,1349 **** } ! chance = random(1000.0); if (chance < frame_time * poison) { --- 1345,1349 ---- } ! chance = random(1000); if (chance < frame_time * poison) { Index: shpgeror.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpgeror.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpgeror.cpp 26 Feb 2004 21:33:26 -0000 1.1 --- shpgeror.cpp 28 Feb 2004 01:05:48 -0000 1.2 *************** *** 388,394 **** { if (space_zoom <= 1) ! set_trans_blender(0, 0, 0, space_zoom * 255 * t * (4-j) / 4.0); else ! set_trans_blender(0, 0, 0, 1 * 255 * t * (4-j) / 4.0); xi = iround(x0 - dx * j); yi = iround(y0 - dy * j); --- 388,394 ---- { if (space_zoom <= 1) ! set_trans_blender(0, 0, 0, iround(space_zoom * 255 * t * (4-j) / 4.0)); else ! set_trans_blender(0, 0, 0, (1 * 255 * t * (4-j) / 4.0)); xi = iround(x0 - dx * j); yi = iround(y0 - dy * j); *************** *** 548,550 **** } ! REGISTER_SHIP ( JadOrion ) \ No newline at end of file --- 548,550 ---- } ! REGISTER_SHIP ( JadOrion ) Index: shpgerra.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpgerra.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpgerra.cpp 26 Feb 2004 21:33:26 -0000 1.1 --- shpgerra.cpp 28 Feb 2004 01:05:48 -0000 1.2 *************** *** 476,478 **** } ! REGISTER_SHIP(JadRacer) \ No newline at end of file --- 476,478 ---- } ! REGISTER_SHIP(JadRacer) Index: shpsefn2.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpsefn2.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpsefn2.cpp 26 Feb 2004 21:33:26 -0000 1.1 --- shpsefn2.cpp 28 Feb 2004 01:05:48 -0000 1.2 *************** *** 1128,1132 **** // simulate visibility of a glittering line in the sun ... double a, colscale; ! a = atan2(dy,dx); colscale = fabs(sin(a)); // flat lying = less visible. --- 1128,1132 ---- // simulate visibility of a glittering line in the sun ... double a, colscale; ! a = atan2f(dy,dx); colscale = fabs(sin(a)); // flat lying = less visible. |
From: <yu...@us...> - 2004-02-28 01:15:04
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25721/source/melee Modified Files: mview.cpp mview.h Log Message: Added first real GOB quest (youBastrd you have to look :) ) Fixed bug with PrintMessage function Readded icon for MSVC (need to change twwin.dsp to text format) Added debug info for release configuration Timewarp compile with GCC again Index: mview.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mview.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** mview.cpp 17 Feb 2004 15:31:49 -0000 1.17 --- mview.cpp 28 Feb 2004 01:05:50 -0000 1.18 *************** *** 375,379 **** void View::calculate(Game *game) {} ! void message_type::out(char *string, int dur, int c) {STACKTRACE ASSERT (c < 256); if (num_messages == max_messages - 1) { --- 375,379 ---- void View::calculate(Game *game) {} ! void message_type::out(const char *string, int dur, int c) {STACKTRACE ASSERT (c < 256); if (num_messages == max_messages - 1) { Index: mview.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mview.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mview.h 29 Jan 2004 21:20:29 -0000 1.6 --- mview.h 28 Feb 2004 01:05:50 -0000 1.7 *************** *** 124,128 **** void animate(Frame *frame); void flush(); ! void out(char *string, int dur = 2000, int c = 15); void print(int dur, int c, const char *format, ...); } extern message; --- 124,128 ---- void animate(Frame *frame); void flush(); ! void out(const char *string, int dur = 2000, int c = 15); void print(int dur, int c, const char *format, ...); } extern message; |
From: <yu...@us...> - 2004-02-28 01:15:04
|
Update of /cvsroot/timewarp/source/gamex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25721/source/gamex Modified Files: gamemelee.cpp Log Message: Added first real GOB quest (youBastrd you have to look :) ) Fixed bug with PrintMessage function Readded icon for MSVC (need to change twwin.dsp to text format) Added debug info for release configuration Timewarp compile with GCC again Index: gamemelee.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamemelee.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gamemelee.cpp 29 Jan 2004 21:20:28 -0000 1.9 --- gamemelee.cpp 28 Feb 2004 01:05:49 -0000 1.10 *************** *** 40,44 **** { Control *c = 0; - int channel = 0; if (human) --- 40,43 ---- |
Update of /cvsroot/timewarp/gamedata In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25721/gamedata Modified Files: TestQuest.lua TestQuestSource.lua Added Files: human.bmp SecretPlanet.lua spathi.bmp SPATHI.MOD ur-quan.bmp UR-QUAN.MOD Log Message: Added first real GOB quest (youBastrd you have to look :) ) Fixed bug with PrintMessage function Readded icon for MSVC (need to change twwin.dsp to text format) Added debug info for release configuration Timewarp compile with GCC again --- NEW FILE: human.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: SecretPlanet.lua --- -- Based on "SecretPlanet dialog for CTree" by youBastrd Exist = 1; matter_investigated = 0; -- if player have Visited Kohr-Ah station next_remind_time = 10000; -- nex time player recive strange notification first_strange_notification = 0; -- player allready resived strange message kzedrKilled = 3; -- Number Dreadnoughts to kill Complited = 0; station_x = 0; station_y = 0; function Process(time, enemy, kills, x, y, res_num1, res_num2, res_str) if time > next_remind_time then StrangeMessage(); next_remind_time = next_remind_time + 100000; end; end function StrangeMessage() PrintMessage("XXXX...Hierarchy summon... piss"); if first_strange_notification == 0 and matter_investigated == 0 then FirstDialog(); first_strange_notification = 1; end; end function FirstDialog() DialogStart "gamedata/human.bmp" DialogWrite "We have intercepted hyperwave radio transmissions using old Hierarchy frequencies..." DialogKeyPressed(); DialogWrite "... which are coming from the planet's located in this region of space. Please investigate the matter" DialogAnswer ("Aye Aye, sir."); DialogWrite "Be careful, this can be dangerous!" DialogKeyPressed(); DialogEnd() end; function GAME_EVENT_SHIP_DIE( Type ) if matter_investigated == 1 then if Type == "kzedr" then kzedrKilled = kzedrKilled - 1 end if kzedrKilled == 0 then Complited = 1; PrintMessage("Mission Completed."); end end end function GAME_EVENT_ENTER_STATION( location, x, y ) station_x = x; station_y = y; if location == "Kohr-Ah" then if matter_investigated == 0 then -- Big Fun dialog DialogStart "gamedata/spathi.bmp"; DialogSetMusic "gamedata/spathi.mod"; function Question1() -- STARTCONVERSATION DialogWrite "What are you doing here? This planet is strictly off limits to -- I mean -- Hi, how would like to avoid killing me today?"; local answer = DialogAnswer ("We heard your transmissions and thought you might be Ur-Quans", "Nothing for now. So long!" ); if answer == 1 then return Question2() end if answer == 2 then matter_investigated = -1; DialogWrite "Ok, so long!"; DialogKeyPressed(); return; end end function Question2() -- URQUAN DialogWrite "Ur-Quans? Ha! No way, no Ur-Quans here. Those guys are way too intense for us." DialogKeyPressed(); DialogWrite "Rather, we prefer a quiet, easy-going setting..." DialogKeyPressed(); DialogWrite "which does not involve us getting painfully obliterated." local answer = DialogAnswer ("Are you sure? There were transmissions coming near your location.", "So long! Keep your stick on the ice!" ); if answer == 1 then return Question3() end if answer == 2 then matter_investigated = -1; DialogWrite "Ok, so long!"; DialogKeyPressed(); return; end end function Question3() -- URQUAN2 DialogWrite "Ur-Quans? Far from it, captain. The transmissions were actually..."; DialogKeyPressed(); DialogWrite "...well this is kind of embarassing..."; DialogKeyPressed(); DialogWrite "homemade videos of myself I was sending to my spawning parter, Fwinda, on Spathiwa..."; DialogKeyPressed(); DialogWrite "who is what I believe you hunams call my mate."; local answer = DialogAnswer ("I guess not all Spathi are shy.", "So long! Keep your stick on the ice!"); if answer == 1 then return Question4() end if answer == 2 then matter_investigated = -1; DialogWrite "Ok, so long!"; DialogKeyPressed(); return end end function Question4() -- MAIN DialogWrite "Ahem. Yes, well, where were we?"; local answer = DialogAnswer ("Well, what are you doing here?", "Have you seen any Ur-Quan around here?"); if answer == 1 then return Question5() end if answer == 2 then return Question6() end end function Question5() -- DOING1 DialogWrite "As I'm sure you know, this planet was uninhabited for quite some time."; DialogKeyPressed(); DialogWrite "And the last time we spoke to your species, was just before we..."; DialogKeyPressed(); DialogWrite "wisely evaded the rest of the universe under our self-made slave shield."; DialogKeyPressed(); DialogWrite "But a few of us brave Spathi grew tired of being under the shield,"; DialogKeyPressed(); DialogWrite "and decided to get our extremeties wet in the real universe."; local answer = DialogAnswer ("Are you kidding? Brave Spathi?", "Let's talk about something else.", "So long! Keep your stick on the ice!"); if answer == 1 then return Question7() end if answer == 2 then return Question8() end if answer == 3 then matter_investigated = -1; DialogWrite "Ok, so long!"; DialogKeyPressed(); return end end function Question6() -- MAIN (from second position) DialogWrite "Nope, not a one! You can normally tell where there is Ur-Quan activity."; DialogKeyPressed(); DialogWrite "Their presence is usually marked with a lack of any other kind of activity..."; DialogKeyPressed(); DialogWrite "except for smoking remains."; local answer = DialogAnswer ("Well, what are you doing here?", "Have you seen any Ur-Quan around here?"); if answer == 1 then return Question5() end if answer == 2 then return Question6() end end function Question7() -- DOING2 (from 3 position) DialogWrite "Oh, for sure! You know, just because we multiply in the tens of thousands,"; DialogKeyPressed(); DialogWrite "as there's safety in numbers,"; DialogKeyPressed(); DialogWrite "and just because any of our species will choose to rather run from any fight,"; DialogKeyPressed(); DialogWrite "with our appendages flailing in the air," DialogKeyPressed(); DialogWrite "doesn't mean that there's no brave Spathi." DialogKeyPressed(); DialogWrite "The brave few of us just stand out of the crowd a little more, that's all." local answer = DialogAnswer ("So what kind of things have you been doing here?", "How did you get past the slave shield around your homeworld?", "Let's talk about something else."); if answer == 1 then return Question9() end if answer == 2 then return Question10() end if answer == 3 then return Question8() end end; function Question8() -- MAIN (from 3,4 position) DialogWrite "Sure, let's talk about something else."; local answer = DialogAnswer ("Well, what are you doing here?", "Have you seen any Ur-Quan around here?"); if answer == 1 then return Question5() end if answer == 2 then return Question6() end end function Question9() -- DOING3A DialogWrite "Oh, not much, just kicking around on this planet,"; DialogKeyPressed(); DialogWrite "taking a break from being terrified of everything on Spathiwa,"; DialogKeyPressed(); DialogWrite "by being terrified by everything here." local answer = DialogAnswer ("That doesn't sound too believable, you came all this way to do nothing?", "How did you get past the slave shield around your homeworld?", "Let's talk about something else.", "So long! Keep your stick on the ice!"); if answer == 1 then return Question11() end if answer == 2 then return Question10() end if answer == 3 then return Question8() end if answer == 4 then matter_investigated = -1; DialogWrite "Ok, so long!"; DialogKeyPressed(); return end end function Question10() -- DOING3B DialogWrite "That's a very good question, with a very good answer."; DialogKeyPressed(); DialogWrite "We just, um, went around it."; local answer = DialogAnswer ("So what kind of things have you been doing here?", "You... went around it? How? It goes around the entire planet!", "Let's talk about something else.", "So long! Keep your stick on the ice!"); if answer == 1 then return Question9() end if answer == 2 then return Question12() end if answer == 3 then return Question8() end if answer == 4 then matter_investigated = -1; DialogWrite "Ok, so long!"; DialogKeyPressed(); return end end function Question11() -- LIEING1 DialogWrite "Well we came here, to, um see how the stars look from way over here."; local answer = DialogAnswer ("Somehow, I just don't believe you. What are you covering up?"); if answer == 1 then return Question13() end; end function Question12() -- LIENG1(2) DialogWrite "Near the polar regions, there's, um, weaker spots in the shield."; DialogKeyPressed(); DialogWrite "We just took a lander ship, bounced around a little until it wanted to go through,"; DialogKeyPressed(); DialogWrite "and saw open space for the first time in years!" DialogKeyPressed(); DialogWrite "Then we, um, flew out here... in the lander... and laned on this planet. For no real reason."; local answer = DialogAnswer ("Somehow, I just don't believe you. What are you covering up?"); if answer == 1 then return Question13() end; end function Question13() -- LEING2 DialogWrite "I can't take it anymore! I can't stand lieing to you, hunam!"; DialogSetMusic "gamedata/ur-quan.mod"; DialogKeyPressed(); DialogWrite "We've been taken captive by the Ur-Quan!"; DialogKeyPressed(); DialogWrite "They're doing things to ... down here, trying to change us ... soldiers ..."; DialogKeyPressed(); DialogWrite "Oh no! .... are jamming ... can't ..."; DialogKeyPressed(); DialogSetAlienImage "gamedata/ur-quan.bmp" DialogWrite "This transmission cannot be allowed."; DialogKeyPressed(); DialogWrite "You are not welcome here."; DialogKeyPressed(); DialogWrite "These creatures are ours, now." local answer = DialogAnswer ("You bastrd! What have you been doing here?", "Hey, slimeball, didn't I waste you years ago?", "Ever think of joining forces with us?", "You are so dead, pal!", "Well, look at the time. Gotta run!") if answer == 1 then return Question14() end if answer == 2 then return Question15() end if answer == 3 then return Question16() end if answer == 4 then return Question17() end if answer == 5 then DialogWrite "Not so easy, human. Time to die."; DialogKeyPressed(); CreateFight(); return; end end function Question14() -- INTENTIONS DialogWrite "That is not your concern." DialogKeyPressed(); DialogWrite "You have interfered with our plans all too often."; DialogKeyPressed(); DialogWrite "Our intentions with these subordinates is only our concern." DialogAnswer ("The Spathi are no longer your subordinates."); DialogWrite "The Spathi on the surface were taken from their homeworld and brought here."; DialogKeyPressed(); DialogWrite "If they had completed their simple task of remaining silent,"; DialogKeyPressed(); DialogWrite "and warned all who came near to leave,"; DialogKeyPressed(); DialogWrite "then we would not have this conflict."; DialogKeyPressed(); DialogSetAlienImage "gamedata/spathi.bmp"; DialogWrite "I'm swtiching to another frequency, can you hear me hunam?"; DialogKeyPressed(); DialogWrite "Please don't let me die! Tomorrow would be much better!"; DialogKeyPressed(); DialogSetAlienImage "gamedata/ur-quan.bmp"; DialogWrite "Be silent, Spathi."; DialogKeyPressed(); DialogWrite "Your death will come soon enough."; DialogKeyPressed(); DialogWrite "Your species' choice to be hidden under the slave shield would protect your species from harm," DialogKeyPressed(); DialogWrite "but you forgot that it was we who used the slave shield on countless planets..."; DialogKeyPressed(); DialogWrite "and we who could bypass it."; DialogKeyPressed(); DialogWrite "While it protected you from harm from outsiders," DialogKeyPressed(); DialogWrite "It also prevented the scans from your allies above."; DialogKeyPressed(); DialogWrite "This made your Spathiwa the perfect planet"; DialogKeyPressed(); DialogWrite "on which to train a vast army." DialogKeyPressed(); DialogSetAlienImage "gamedata/spathi.bmp"; DialogWrite "Nooo! Fwinda!" DialogKeyPressed(); DialogWrite "I'll probably lose my pr0n collection too!"; DialogKeyPressed(); DialogSetAlienImage "gamedata/ur-quan.bmp"; DialogAnswer ("Hey creepy-looking slimey thing, um, the evil one of the two: you forgot that the Spathi are wimps!"); DialogWrite "While this is true,"; DialogKeyPressed(); DialogWrite "our methods of training can turn any species into formitable warriors."; DialogKeyPressed(); DialogWrite "By bringing these few Spathi here, we can determine if their species can be changed."; DialogKeyPressed(); DialogWrite "Should we be successful, we will breed these soldiers in vast numbers."; DialogKeyPressed(); DialogWrite "Be warned, foolish human, you cannot resist us forever."; DialogKeyPressed(); DialogWrite "You will submit, or die!"; DialogKeyPressed(); local answer = DialogAnswer ("You are so dead, pal!", "Well, look at the time. Gotta run!"); if answer == 1 then return Question17() end if answer == 2 then DialogWrite("You know too much, human."); DialogKeyPressed(); return Question17() end end function Question15() -- DIALOG (2) DialogWrite "We, the Ur-Quan Kzer-za, are strong."; DialogKeyPressed(); DialogWrite "We are not so easily defeated."; DialogKeyPressed(); DialogWrite "We will be restored to our former stature as overlords of many species..."; DialogKeyPressed(); DialogWrite "as it has been for millenia." local answer = DialogAnswer ("You bastrd! What have you been doing here?", "Hey, slimeball, didn't I waste you years ago?", "Ever think of joining forces with us?", "You are so dead, pal!", "Well, look at the time. Gotta run!") if answer == 1 then return Question14() end if answer == 2 then return Question15() end if answer == 3 then return Question16() end if answer == 4 then return Question17() end if answer == 5 then DialogWrite "Not so easy, human. Time to die."; DialogKeyPressed(); CreateFight(); return; end end function Question16() -- DIALOG (3) DialogWrite "Your pitiful attempt to ... yadda yadda ..." local answer = DialogAnswer ("You bastrd! What have you been doing here?", "Hey, slimeball, didn't I waste you years ago?", "Ever think of joining forces with us?", "You are so dead, pal!", "Well, look at the time. Gotta run!") if answer == 1 then return Question14() end if answer == 2 then return Question15() end if answer == 3 then return Question16() end if answer == 4 then return Question17() end if answer == 5 then DialogWrite "Not so easy, human. Time to die."; DialogKeyPressed(); CreateFight(); return; end end function Question17() -- COMBAT DialogWrite "Die, human"; DialogKeyPressed(); CreateFight(); end Question1(); DialogEnd (); matter_investigated = matter_investigated + 1; return; end if Complited == 0 then -- Ur-quan boasting DialogStart "gamedata/ur-quan.bmp" DialogSetMusic "gamedata/ur-quan.mod"; DialogWrite ("We will destroy you our ships already on they way!!!"); DialogAnswer ("Ha"); DialogEnd(); end if Complited == 1 and Exist == 1 then -- Dialog about capturing kohr-ah factory DialogStart "gamedata/spathi.bmp" DialogSetMusic "gamedata/spathi.mod"; DialogWrite ("Savior!!! We have Ur-quan ship factory here and now we leave it to you. It can produce Kohr-Ah Marauders!!!"); DialogKeyPressed(); DialogWrite ("We are off to Spathiwa, we will send you bill for factory from there"); DialogAnswer ("Uuuu"); DialogEnd(); MakeAlly(station_x, station_y); Exist = 0; return; end end end function CreateFight() AddEnemyShip("kzedr", station_x, station_y); AddEnemyShip("kzedr", station_x, station_y); AddEnemyShip("kzedr", station_x, station_y); end --- NEW FILE: spathi.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: SPATHI.MOD --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ur-quan.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: UR-QUAN.MOD --- (This appears to be a binary file; contents omitted.) Index: TestQuest.lua =================================================================== RCS file: /cvsroot/timewarp/gamedata/TestQuest.lua,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TestQuest.lua 5 Feb 2004 01:36:19 -0000 1.6 --- TestQuest.lua 28 Feb 2004 01:05:50 -0000 1.7 *************** *** 11,19 **** end ! function GAME_EVENT_ENTER_STATION( locationID ) ! -- if locationID == QuestSourceLocationID then if Complited == 1 then return Reward() end return HurryLazyPlayer() ! -- end end --- 11,19 ---- end ! function GAME_EVENT_ENTER_STATION( location, x, y ) ! if location == "Supox" then if Complited == 1 then return Reward() end return HurryLazyPlayer() ! end end *************** *** 23,27 **** answer = DialogAnswer ( "Thanks!" ) AddBuckazoids(20); ! Exist = 1; DialogEnd() end --- 23,27 ---- answer = DialogAnswer ( "Thanks!" ) AddBuckazoids(20); ! Exist = 0; DialogEnd() end Index: TestQuestSource.lua =================================================================== RCS file: /cvsroot/timewarp/gamedata/TestQuestSource.lua,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestQuestSource.lua 5 Feb 2004 01:36:19 -0000 1.1 --- TestQuestSource.lua 28 Feb 2004 01:05:50 -0000 1.2 *************** *** 9,15 **** quests = { ! {name = "ShofixtyQuest", file="gamedata/TestQuest.lua", status = UNTOUCHED }, ! {name = "ShofixtyQuest", file="gamedata/TestQuest.lua", status = UNTOUCHED } ! } -- when quest succesfuly complited, -- index - index of complited quest --- 9,15 ---- quests = { ! {name = "ShofixtyQuest", file="gamedata/TestQuest.lua", status = UNTOUCHED }, ! {name = "Ur-QuanQuest", file="gamedata/SecretPlanet.lua", status = UNTOUCHED } ! } -- when quest succesfuly complited, -- index - index of complited quest *************** *** 30,34 **** return "gamedata/TestQuest.lua"; end ! return "NO_DATA" end --- 30,34 ---- return "gamedata/TestQuest.lua"; end ! return "NO_QUEST" end |
From: <yu...@us...> - 2004-02-28 01:15:04
|
Update of /cvsroot/timewarp/source/other In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25721/source/other Modified Files: gdialog.cpp gdialog.h gquest.cpp gquest.h luaport.h Log Message: Added first real GOB quest (youBastrd you have to look :) ) Fixed bug with PrintMessage function Readded icon for MSVC (need to change twwin.dsp to text format) Added debug info for release configuration Timewarp compile with GCC again Index: gdialog.cpp =================================================================== RCS file: /cvsroot/timewarp/source/other/gdialog.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gdialog.cpp 26 Feb 2004 17:45:51 -0000 1.5 --- gdialog.cpp 28 Feb 2004 01:05:49 -0000 1.6 *************** *** 25,28 **** --- 25,30 ---- static BITMAP * g_btmOld = NULL; bool g_bPause = false; + Music* old_music = NULL; + Music* music = NULL; static int alien_image_x = 0; *************** *** 60,64 **** --- 62,68 ---- lua_register(L, "DialogStart", l_DialogStart); lua_register(L, "DialogSetAlienImage", l_DialogSetAlienImage); + lua_register(L, "DialogSetMusic", l_DialogSetMusic); lua_register(L, "DialogWrite", l_DialogWrite); + lua_register(L, "DialogKeyPressed", l_KeyPressed); lua_register(L, "DialogAnswer", l_DialogAnswer); lua_register(L, "DialogEnd", l_DialogEnd ); *************** *** 90,93 **** --- 94,100 ---- game->window->unlock(); + if (sound.is_music_playing()) + old_music = sound.looping_music; + return l_DialogSetAlienImage(ls); } *************** *** 124,127 **** --- 131,158 ---- } + int l_DialogSetMusic(lua_State* ls) + { + if ( !lua_isstring(ls, 1) ) + { + tw_error("SetAlienImage was summoned without image string"); + } + const char* mod = lua_tostring(ls, 1); + + if (music) + { + sound.stop_music(); + sound.unload_music(music); + } + + music = sound.load_music(mod); + + if (!music && sound.is_music_supported()) + tw_error("Couldnt load music"); + + if (music) sound.play_music( music, TRUE); + + return 0; + } + int l_DialogWrite(lua_State* ls) { *************** *** 152,155 **** --- 183,191 ---- + int l_KeyPressed (lua_State* ls) + { + readkey(); + return 0; + } int l_DialogAnswer(lua_State* ls) *************** *** 205,208 **** --- 241,257 ---- g_btmAlien = NULL; + if (old_music) + { + if (music) + { + sound.stop_music(); + sound.unload_music(music); + } + sound.play_music( old_music, TRUE); + } + + old_music = NULL; + music = NULL; + if( !g_bPause ) game->unpause(); Index: gdialog.h =================================================================== RCS file: /cvsroot/timewarp/source/other/gdialog.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gdialog.h 14 Jan 2004 11:12:32 -0000 1.2 --- gdialog.h 28 Feb 2004 01:05:49 -0000 1.3 *************** *** 13,17 **** --- 13,19 ---- int l_DialogStart(lua_State* ls); int l_DialogSetAlienImage(lua_State* ls); + int l_DialogSetMusic(lua_State* ls); int l_DialogWrite(lua_State* ls); + int l_KeyPressed (lua_State* ls); int l_DialogAnswer(lua_State* ls); int l_DialogEnd ( lua_State* ls ); Index: gquest.cpp =================================================================== RCS file: /cvsroot/timewarp/source/other/gquest.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** gquest.cpp 7 Feb 2004 07:43:37 -0000 1.13 --- gquest.cpp 28 Feb 2004 01:05:49 -0000 1.14 *************** *** 30,33 **** --- 30,36 ---- lua_register(L, "Dialog", l_Dialog); lua_register(L, "AddObject", l_AddObject); + lua_register(L, "AddEnemyShip", l_AddEnemyShip); + lua_register(L, "MakeEnemy", l_MakeEnemy); + lua_register(L, "MakeAlly", l_MakeAlly); lua_register(L, "RemoveObject", l_RemoveObject); lua_register(L, "AddBuckazoids", l_AddBuckazoids); *************** *** 35,39 **** // Load Quest ! lua_dofile(L, szLuaFile); // Register Events --- 38,46 ---- // Load Quest ! ! if ( lua_dofile(L, szLuaFile) != 0) ! { ! tw_error("Unable Error in Lua quest file"); ! }; // Register Events *************** *** 135,141 **** --- 142,151 ---- void Quest::ProcessEvent ( IEvent* event ) { + Query q; g_player = gob_player; int type = event->GetEventType(); int top; + Vector2 pos; + int x, y; const char * temp; switch ( type ) *************** *** 174,182 **** }; ! lua_pushnumber( L, 1 ); //need to be implemented ! lua_call(L, 1, 0 ); ! lua_settop(L, top); break; default: --- 184,198 ---- }; ! lua_pushstring( L, (((EventEnterStation*)event)->station->GetStationName()).c_str() ); //reserved ! pos = ((EventEnterStation*)event)->station->pos; ! x = iround(pos.x); ! y = iround(pos.y); ! lua_pushnumber (L, x); ! lua_pushnumber (L, y); + lua_call(L, 3, 0 ); + lua_settop(L, top); + break; default: *************** *** 194,198 **** { gobgame->add_new_enemy(); ! return NOT_IMPLEMENTED; } --- 210,274 ---- { gobgame->add_new_enemy(); ! return 0; ! } ! ! int Quest::l_AddEnemyShip(lua_State* ls) ! { ! int top = lua_gettop(ls); ! if ( top != 3 ) ! { ! tw_error ("Wrong argument count for AddEnemyShip"); ! } ! Vector2 pos; ! const char * type = lua_tostring(ls, 1); ! pos.x = lua_tonumber(ls, 2); ! pos.y = lua_tonumber(ls, 3); ! ! gobgame->add_new_enemy(type, &pos); ! return 0; ! } ! ! int Quest::l_MakeEnemy(lua_State* ls) ! { ! int top = lua_gettop(ls); ! if ( top != 2 ) ! { ! tw_error ("Wrong argument count for AddEnemyShip"); ! } ! Vector2 pos; ! pos.x = lua_tonumber(ls, 2); ! pos.y = lua_tonumber(ls, 3); ! ! Query q; ! for (q.begin(g_player->ship, bit(LAYER_CBODIES), 24000); q.current; q.next()) ! { ! if( (q.current)->pos.round() == pos.round()) ! { ! ((GobStation*)(q.current))->set_team(gobgame->enemy_team); ! } ! } ! return 0; ! } ! ! int Quest::l_MakeAlly(lua_State* ls) ! { ! int top = lua_gettop(ls); ! if ( top != 2 ) ! { ! tw_error ("Wrong argument count for AddEnemyShip"); ! } ! Vector2 pos; ! pos.x = lua_tonumber(ls, 2); ! pos.y = lua_tonumber(ls, 3); ! ! Query q; ! for (q.begin(g_player->ship, bit(LAYER_CBODIES), 24000); q.current; q.next()) ! { ! if( (q.current)->pos == pos) ! { ! ((GobStation*)(q.current))->set_team(g_player->ship->get_team()); ! } ! } ! return 0; } *************** *** 220,224 **** } const char * str = lua_tostring(ls, -1); ! message.out((char *)str, 10000, makecol(0,255,0)); return 0; } --- 296,300 ---- } const char * str = lua_tostring(ls, -1); ! message.out((char *)str, 10000, makecol8(0,255,0)); return 0; } *************** *** 320,323 **** --- 396,400 ---- ASSERT(name); Quest * q = new Quest( name, player ); + questList.push_back(q); return q; } Index: gquest.h =================================================================== RCS file: /cvsroot/timewarp/source/other/gquest.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gquest.h 5 Feb 2004 01:36:18 -0000 1.8 --- gquest.h 28 Feb 2004 01:05:49 -0000 1.9 *************** *** 19,53 **** class Quest: public EventListner { ! bool bExist; ! lua_State * L; ! GobPlayer * gob_player; ! std::string strName; ! public: ! Quest( const char * szLuaFile, GobPlayer * player ); ! virtual ~Quest(); ! /*! \brief Summon default quest handler ! This function summon in every player think() ! */ ! void Process(); ! bool exist(); ! const char * GetName() const; ! GobPlayer * GetPlayer(); ! /*! \brief Process Event */ ! virtual void ProcessEvent( IEvent* event); ! ! private: ! // This is callback functions from Lua quest script ! /*! \brief On complite quest */ ! static int l_Dialog(lua_State* ls); ! /*! \brief Add quest object ( ship, starbase) to the game */ ! static int l_AddObject(lua_State* ls); ! /*! \brief Remove quest object ( ship, starbase ... ) */ ! static int l_RemoveObject(lua_State*ls); ! /*! \brief Add buckazoids */ ! static int l_AddBuckazoids(lua_State*ls); ! /*! \brief Print message */ ! static int l_PrintMessage(lua_State*ls); }; --- 19,65 ---- class Quest: public EventListner { ! bool bExist; ! lua_State * L; ! GobPlayer * gob_player; ! std::string strName; ! public: ! Quest( const char * szLuaFile, GobPlayer * player ); ! virtual ~Quest(); ! /*! \brief Summon default quest handler ! This function summon in every player think() ! */ ! void Process(); ! bool exist(); ! const char * GetName() const; ! GobPlayer * GetPlayer(); ! /*! \brief Process Event */ ! virtual void ProcessEvent( IEvent* event); ! ! private: ! // This is callback functions from Lua quest script ! /*! \brief On complite quest */ ! static int l_Dialog(lua_State* ls); ! /*! \brief Add quest object ( ship, starbase) to the game */ ! static int l_AddObject(lua_State* ls); ! /*! \brief Remove quest object ( ship, starbase ... ) */ ! static int l_RemoveObject(lua_State*ls); ! /*! \brief Add buckazoids */ ! static int l_AddBuckazoids(lua_State*ls); ! /*! \brief Print message */ ! static int l_PrintMessage(lua_State*ls); ! /*! \brief Add Enemy ship */ ! static int l_AddEnemyShip(lua_State* ls); ! /*! \brief Change object team to enemy (x, y - specify object position) ! \param 1 - x ! \param 2 - y ! */ ! static int l_MakeEnemy(lua_State* ls); ! /*! \brief Change object team to player team (x, y - specify object position) ! \param 1 - x ! \paran 2 - y ! */ ! static int l_MakeAlly(lua_State* ls); }; *************** *** 56,76 **** class QuestSource : public EventListner { ! protected: ! lua_State * Lquest; ! std::list<Quest*> questList; ! public: ! QuestSource(); ! virtual ~QuestSource(); ! virtual int LoadQuestList( const char* qlist ); ! virtual Quest* GetNextQuest( GobPlayer* p ); ! virtual Quest* GetQuest ( const char * name, GobPlayer* p ); ! virtual int QuestSuccess( Quest* q ); ! virtual int QuestFailed( Quest* q ); ! ! virtual void RemoveTrash(GobPlayer* pl = NULL); ! virtual void ProcessEvent(IEvent* event); ! virtual void ProcessQuests(); }; --- 68,88 ---- class QuestSource : public EventListner { ! protected: ! lua_State * Lquest; ! std::list<Quest*> questList; ! public: ! QuestSource(); ! virtual ~QuestSource(); ! virtual int LoadQuestList( const char* qlist ); ! virtual Quest* GetNextQuest( GobPlayer* p ); ! virtual Quest* GetQuest ( const char * name, GobPlayer* p ); ! virtual int QuestSuccess( Quest* q ); ! virtual int QuestFailed( Quest* q ); ! virtual void RemoveTrash(GobPlayer* pl = NULL); ! virtual void ProcessEvent(IEvent* event); ! ! virtual void ProcessQuests(); }; Index: luaport.h =================================================================== RCS file: /cvsroot/timewarp/source/other/luaport.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** luaport.h 22 Feb 2004 10:48:38 -0000 1.2 --- luaport.h 28 Feb 2004 01:05:49 -0000 1.3 *************** *** 30,36 **** // also declares the lua-registry class, which is used to build a list of functions available to lua. #define lua_func(func) \ ! extern int func(lua_State *L); \ lua_func_registry regme##func (#func, func); \ ! static int func(lua_State *L) \ { \ int nret = 0; --- 30,36 ---- // also declares the lua-registry class, which is used to build a list of functions available to lua. #define lua_func(func) \ ! int func(lua_State *L); \ lua_func_registry regme##func (#func, func); \ ! int func(lua_State *L) \ { \ int nret = 0; |
From: <yu...@us...> - 2004-02-28 01:14:55
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25721/source Modified Files: gui.cpp Log Message: Added first real GOB quest (youBastrd you have to look :) ) Fixed bug with PrintMessage function Readded icon for MSVC (need to change twwin.dsp to text format) Added debug info for release configuration Timewarp compile with GCC again Index: gui.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gui.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** gui.cpp 20 Feb 2004 08:42:43 -0000 1.16 --- gui.cpp 28 Feb 2004 01:05:49 -0000 1.17 *************** *** 1110,1114 **** ! break;/**/ }; --- 1110,1114 ---- ! break;*/ }; |
From: <yu...@us...> - 2004-02-28 01:14:55
|
Update of /cvsroot/timewarp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25721 Modified Files: Doxyfile ingame.txt scpwin.ico twwin.dsp Removed Files: twwin.sln twwin.vcproj winalleg.h Log Message: Added first real GOB quest (youBastrd you have to look :) ) Fixed bug with PrintMessage function Readded icon for MSVC (need to change twwin.dsp to text format) Added debug info for release configuration Timewarp compile with GCC again Index: ingame.txt =================================================================== RCS file: /cvsroot/timewarp/ingame.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ingame.txt 12 Dec 2003 16:02:49 -0000 1.4 --- ingame.txt 28 Feb 2004 01:05:49 -0000 1.5 *************** *** 1,4 **** ! Run twdos.exe in DOS, or twwin.exe in windows, or twlinux in Linux, ! or twbeos on BeOS. These are the options presented to you in the game: --- 1,3 ---- ! Run twwin.exe in windows, or timewarp in Linux. These are the options presented to you in the game: Index: scpwin.ico =================================================================== RCS file: /cvsroot/timewarp/scpwin.ico,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Binary files /tmp/cvs1Pbf4K and /tmp/cvsScHINF differ Index: twwin.dsp =================================================================== RCS file: /cvsroot/timewarp/twwin.dsp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** twwin.dsp 26 Feb 2004 22:22:47 -0000 1.37 --- twwin.dsp 28 Feb 2004 01:05:49 -0000 1.38 *************** *** 44,48 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MT /W3 /GR /GX /Ox /Ot /Og /Oi /Op /Ob2 /I "./include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "__i386__" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 44,48 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MT /W3 /GR /GX /Zi /O1 /Op /Ob2 /I "./include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "__i386__" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 54,58 **** LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 ! # ADD LINK32 ./lib/alleg.lib user32.lib winmm.lib wsock32.lib ./lib/libjgmod.lib ./lib/lua.lib ./lib/libfreetype.lib /nologo /subsystem:windows /incremental:yes /machine:I386 /nodefaultlib:"LIBCMT" /out:"twwin.exe" # SUBTRACT LINK32 /pdb:none --- 54,58 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 ! # ADD LINK32 ./lib/alleg.lib user32.lib winmm.lib wsock32.lib ./lib/libjgmod.lib ./lib/lua.lib ./lib/libfreetype.lib /nologo /subsystem:windows /incremental:yes /map /debug /machine:I386 /nodefaultlib:"LIBCMT" /out:"twwin.exe" # SUBTRACT LINK32 /pdb:none *************** *** 346,353 **** # Begin Source File - SOURCE=.\source\games\dialog.cpp - # End Source File - # Begin Source File - SOURCE=.\source\games\gamehierarchy.cpp # End Source File --- 346,349 ---- *************** *** 1478,1485 **** # Begin Source File - SOURCE=.\source\games\dialog.h - # End Source File - # Begin Source File - SOURCE=.\source\games\gamehierarchy.h # End Source File --- 1474,1477 ---- *************** *** 1801,1804 **** --- 1793,1800 ---- SOURCE=.\scpwin.ico # End Source File + # Begin Source File + + SOURCE=.\scpwin.rc + # End Source File # End Group # End Target --- twwin.sln DELETED --- --- twwin.vcproj DELETED --- --- winalleg.h DELETED --- |
From: <yu...@us...> - 2004-02-28 01:14:54
|
Update of /cvsroot/timewarp/source/games In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25721/source/games Modified Files: ggob.cpp ggob.h gmissions.cpp Removed Files: dialog.cpp dialog.h Log Message: Added first real GOB quest (youBastrd you have to look :) ) Fixed bug with PrintMessage function Readded icon for MSVC (need to change twwin.dsp to text format) Added debug info for release configuration Timewarp compile with GCC again Index: ggob.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/ggob.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ggob.cpp 26 Feb 2004 17:45:51 -0000 1.26 --- ggob.cpp 28 Feb 2004 01:05:49 -0000 1.27 *************** *** 341,351 **** num_planets = 0; i = 0; ! add_planet_and_station(meleedata.planetSprite, i, stationSprite[i], station_build_name[i], station_pic_name[i]); i = 1; ! add_planet_and_station(meleedata.planetSprite, i, stationSprite[i], station_build_name[i], station_pic_name[i]); i = 2; ! add_planet_and_station(meleedata.planetSprite, i, stationSprite[i], station_build_name[i], station_pic_name[i]); i = random() % 3; ! add_planet_and_station(meleedata.planetSprite, i, stationSprite[i], "utwju", station_pic_name[i]); for (i = 0; i < 19; i += 1) add(new GobAsteroid()); --- 341,351 ---- num_planets = 0; i = 0; ! add_planet_and_station(meleedata.planetSprite, i, stationSprite[i], station_build_name[i], station_pic_name[i], "Supox"); i = 1; ! add_planet_and_station(meleedata.planetSprite, i, stationSprite[i], station_build_name[i], station_pic_name[i], "Orz"); i = 2; ! add_planet_and_station(meleedata.planetSprite, i, stationSprite[i], station_build_name[i], station_pic_name[i], "Kohr-Ah"); i = random() % 3; ! add_planet_and_station(meleedata.planetSprite, i, stationSprite[i], "utwju", station_pic_name[i], "Utwig"); for (i = 0; i < 19; i += 1) add(new GobAsteroid()); *************** *** 437,440 **** --- 437,441 ---- quest_source = new QuestSource(); quest_source->LoadQuestList( "gamedata/TestQuestSource.lua" ); + quest_source->GetQuest("gamedata/SecretPlanet.lua", gobplayer[0]); return; } *************** *** 465,470 **** \param builds ??? \param background ??? */ ! void GobGame::add_planet_and_station ( SpaceSprite *planet_sprite, int planet_index, SpaceSprite *station_sprite, const char *builds, const char *background) { STACKTRACE; --- 466,472 ---- \param builds ??? \param background ??? + \param sname station name (used for station identification ) */ ! void GobGame::add_planet_and_station ( SpaceSprite *planet_sprite, int planet_index, SpaceSprite *station_sprite, const char *builds, const char *background, std::string sname) { STACKTRACE; *************** *** 479,483 **** GobStation *gs = new GobStation(station_sprite, p, builds, ! background, "NOT_IMPLEMENTED" ); gs->collide_flag_sameship = ALL_LAYERS; gs->collide_flag_sameteam = ALL_LAYERS; --- 481,485 ---- GobStation *gs = new GobStation(station_sprite, p, builds, ! background, sname ); gs->collide_flag_sameship = ALL_LAYERS; gs->collide_flag_sameteam = ALL_LAYERS; *************** *** 607,611 **** Create random enemy ship if enemy limit is not riched. Also it patch some of the ships. */ ! void GobGame::add_new_enemy () { STACKTRACE; --- 609,614 ---- Create random enemy ship if enemy limit is not riched. Also it patch some of the ships. */ ! void GobGame::add_new_enemy (std::string type, Vector2* pos ) ! { STACKTRACE; *************** *** 654,658 **** e = e; } ! Ship *ship = create_ship(channel_server, enemy_types[e], "WussieBot", random(size), random(PI2), enemy_team); if (!strcmp(enemy_types[e], "shosc")) ((ShofixtiScout*)ship)->specialDamage /= 4; if (!strcmp(enemy_types[e], "zfpst")) ((ZoqFotPikStinger*)ship)->specialDamage /= 2; --- 657,679 ---- e = e; } ! ! if (type != "") ! { ! int i; ! for (i=0; i<num_enemy_types; i++) ! { ! if (type == enemy_types[i]) ! { ! e = i; ! break; ! } ! } ! } ! Ship *ship; ! if (pos == NULL) ! ship = create_ship(channel_server, enemy_types[e], "WussieBot", random(size), random(PI2), enemy_team); ! else ! ship = create_ship(channel_server, enemy_types[e], "WussieBot", *pos, random(PI2), enemy_team); ! if (!strcmp(enemy_types[e], "shosc")) ((ShofixtiScout*)ship)->specialDamage /= 4; if (!strcmp(enemy_types[e], "zfpst")) ((ZoqFotPikStinger*)ship)->specialDamage /= 2; *************** *** 910,917 **** \param ship ??? \param background ??? */ GobStation::GobStation ( SpaceSprite *pic, SpaceLocation *orbit_me, ! const char *ship, const char *background, ! const char * qlist) : Orbiter(pic, orbit_me, random() % 200 + 500) { --- 931,938 ---- \param ship ??? \param background ??? + \param sname station name */ GobStation::GobStation ( SpaceSprite *pic, SpaceLocation *orbit_me, ! const char *ship, const char *background, std::string sname ) : Orbiter(pic, orbit_me, random() % 200 + 500) { *************** *** 920,923 **** --- 941,947 ---- layer = LAYER_CBODIES; mass = 99; + name = sname; + if (sname=="Kohr-Ah") + set_team(gobgame->enemy_team); } *************** *** 951,955 **** STACKTRACE; ! BITMAP *background = load_bitmap(background_pic, NULL); if (!background) { message.print(1000, 15, "%s", background_pic); --- 975,979 ---- STACKTRACE; ! BITMAP *background = load_bitmap(background_pic, NULL); if (!background) { message.print(1000, 15, "%s", background_pic); *************** *** 963,971 **** game->window->unlock(); - EventEnterStation e; - e.player = s; - e.station = this; - gobgame->GenerateEvent(&e); - while (true) { sprintf(dialog_string[0], "%03d Starbucks %03d Buckazoids", s->starbucks, s->buckazoids); --- 987,990 ---- *************** *** 1070,1074 **** if (a == -1) a = 0; p->write_pair(buffy, a+1); ! station_screen(p); gobgame->unpause(); return; --- 1089,1101 ---- if (a == -1) a = 0; p->write_pair(buffy, a+1); ! ! EventEnterStation e; ! e.player = p; ! e.station = this; ! gobgame->GenerateEvent(&e); ! ! if (get_team()!=gobgame->enemy_team) ! station_screen(p); ! gobgame->unpause(); return; Index: ggob.h =================================================================== RCS file: /cvsroot/timewarp/source/games/ggob.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ggob.h 24 Feb 2004 23:21:55 -0000 1.13 --- ggob.h 28 Feb 2004 01:05:49 -0000 1.14 *************** *** 93,97 **** ! void add_new_enemy(); int next_add_new_enemy_time; --- 93,97 ---- ! void add_new_enemy(std::string type = "", Vector2* pos = NULL); int next_add_new_enemy_time; *************** *** 106,110 **** Planet *planet[16]; GobStation *station[16]; ! void add_planet_and_station ( SpaceSprite *planet_sprite, int planet_index, SpaceSprite *station_sprite, const char *builds, const char *background); void save_game(); --- 106,115 ---- Planet *planet[16]; GobStation *station[16]; ! void add_planet_and_station ( SpaceSprite *planet_sprite, ! int planet_index, ! SpaceSprite *station_sprite, ! const char *builds, ! const char *background, ! std::string sname); void save_game(); *************** *** 116,119 **** --- 121,125 ---- class GobStation : public Orbiter { + std::string name; public: const char *build_type; *************** *** 121,126 **** GobStation ( SpaceSprite *pic, SpaceLocation *orbit_me, const char *ship, const char *background, ! const char *qlist ); virtual ~GobStation(); virtual void buy_new_ship_menu(GobPlayer *s) ; virtual void inflict_damage(SpaceObject *other); --- 127,135 ---- GobStation ( SpaceSprite *pic, SpaceLocation *orbit_me, const char *ship, const char *background, ! std::string sname ); virtual ~GobStation(); + + std::string GetStationName(){return name;} + virtual void buy_new_ship_menu(GobPlayer *s) ; virtual void inflict_damage(SpaceObject *other); Index: gmissions.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/gmissions.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** gmissions.cpp 29 Jan 2004 21:20:28 -0000 1.22 --- gmissions.cpp 28 Feb 2004 01:05:49 -0000 1.23 *************** *** 28,32 **** #include "gplexplr.h" - #include "dialog.h" #include <string.h> --- 28,31 ---- --- dialog.cpp DELETED --- --- dialog.h DELETED --- |
From: <geo...@us...> - 2004-02-26 22:31:35
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13653/newships Added Files: _howto_1.cpp _howto_2.cpp Log Message: adding simple ship writing example --- NEW FILE: _howto_1.cpp --- #include "../ship.h" REGISTER_FILE /* Ship-Howto. The following creates a ship class, for a ship which can just fly around, and do nothing else. Note that the base class is Ship, which handles all I/O, animation, and such. */ class HowTo_1 : public Ship { public: /* constructor of a new ship. opos = a Vector2, (x,y) coordinate where the ship is located --> copied into "pos" shipAngle = the angle (in radian, so between -pi and pi) it faces when it's spawned --> copied into "angle" shipData = contains the images and sounds of the ship. These are initialized externally, using info in the data file. --> amonng this, sets the "sprite" data shipCollideFlag = keeps track of team ownership, and collision stuff. */ HowTo_1(Vector2 opos, double shipAngle, ShipData *shipData, int shipCollideFlag); }; HowTo_1::HowTo_1(Vector2 opos, double shipAngle, ShipData *shipData, int shipCollideFlag) : Ship(opos, shipAngle, shipData, shipCollideFlag) { }; /* The following registers a ship. The supplied identifier is used by the macro to generate a code name-id, which can be called in ships.ini files so that the correct data are loaded for the correct code. */ REGISTER_SHIP(HowTo_1); --- NEW FILE: _howto_2.cpp --- #include "../ship.h" REGISTER_FILE /*Ship-Howto 2. How to make a ship fire a (default) weapon */ class HowTo_2 : public Ship { // parameters we need to define weapon behaviour double weaponRange, weaponVelocity, weaponDamage; int weaponArmour; public: HowTo_2(Vector2 opos, double shipAngle, ShipData *shipData, int shipCollideFlag); /* This is called by the Ship class, when the fire-button is pressed. By default is does nothing, but you can overload it to spawn some weapon. */ virtual int activate_weapon(); }; HowTo_2::HowTo_2(Vector2 opos, double shipAngle, ShipData *shipData, int shipCollideFlag) : Ship(opos, shipAngle, shipData, shipCollideFlag) { // the range. The scale_range scales from "sc2" values to pixel values. weaponRange = scale_range(get_config_float("Weapon", "Range", 0)); // the velocity. The scale_velocity scales from "sc2" values to pixel/second values weaponVelocity = scale_velocity(get_config_float("Weapon", "Velocity", 0)); // the damage done when it hits some object. For normal weapon types, this subtracts the specified amount of crew if the. weaponDamage = get_config_int("Weapon", "Damage", 0); // armour = how many hit points it absorbs, before it dies. weaponArmour = get_config_int("Weapon", "Armour", 0); }; HowTo_2::activate_weapon() { Missile *m; // how far away from the ship does this missile start its violent existence. Vector2 offset = Vector2(0.0, size.y / 2.0 + 10); // creates a new missile, but this is just some memory allocation. m = new Missile(this, offset, angle, weaponVelocity, weaponDamage, weaponRange, weaponArmour, this, data->spriteWeapon); // adds to the physics (class Physics - but you can also use game->add, which adds to the physics anyway) // Thus this object is put in a list, and its subroutines can then invoked during game iteration. physics->add(m); // meaningless. return 0; } REGISTER_SHIP(HowTo_2); |
From: <geo...@us...> - 2004-02-26 22:31:02
|
Update of /cvsroot/timewarp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13527 Modified Files: twwin.dsp Log Message: adding simple ship writing example |
From: <geo...@us...> - 2004-02-26 21:45:51
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3317 Modified Files: shpalhdr.ini shpsefna.ini Log Message: placing old version into b-class Index: shpalhdr.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpalhdr.ini,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** shpalhdr.ini 5 Jan 2004 21:59:54 -0000 1.10 --- shpalhdr.ini 26 Feb 2004 21:37:37 -0000 1.11 *************** *** 5,9 **** Name1 = Alhordian Name2 = Corona ! Origin = TWa Coders = Varith Code = AlhordianDreadnought --- 5,9 ---- Name1 = Alhordian Name2 = Corona ! Origin = TWb Coders = Varith Code = AlhordianDreadnought Index: shpsefna.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpsefna.ini,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** shpsefna.ini 5 Jan 2004 21:59:54 -0000 1.4 --- shpsefna.ini 26 Feb 2004 21:37:37 -0000 1.5 *************** *** 1,4 **** [Info] ! Origin = TWa SC1Cost = 10 SC2Cost = 10 --- 1,4 ---- [Info] ! Origin = TWb SC1Cost = 10 SC2Cost = 10 |
From: <geo...@us...> - 2004-02-26 21:44:47
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2978 Added Files: shpalhha.dat shpalhha.ini shpastba.dat shpastba.ini shpastba.txt shpgeror.dat shpgeror.ini shpgeror.txt shpgerra.dat shpgerra.ini shpgerra.txt shpsefn2.dat shpsefn2.ini Log Message: adding some of Jads ships --- NEW FILE: shpalhha.dat --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shpalhha.ini --- [Info] SC1Cost = 18 SC2Cost = 18 TWCost = 18 Name1 = Alhordian Name2 = Halo Origin = TW Coders = Varith [w/ Jad] Code = AlhordianHalo [Ship] Crew = 18 CrewMax = 18 Batt = 20 BattMax = 20 SpeedMax = 18 AccelRate = 2.5 TurnRate = 6 RechargeAmount = 1 RechargeRate = 3.5 WeaponDrain = 3 WeaponRate = 7 SpecialDrain = 2.5 SpecialRate = 1 HotspotRate = 4 Mass = 13 [Weapon] StartVelocity = 102.5 StartDamage = 1 ;1;5 EndDamage = 3 ;4;1 StartArmour = 1 EndArmour = 3 Relativity = 0.5 StartFriction = 0.0000 EndFriction = 0.0000 Lifetime = 1000 [Special] ;setting this to 0 SHOULD turn it off, ;though I'm not particularly sure if it really does... FiringRate = 0.1 ; in "frames" CoolTime = 50 Factor = 1.5 StartAngle = -155 EndAngle = -5 StartRange = 5.5 ;3 EndRange = 5.5 ;8 Time = 1200 Damage = 1 Sustain = 100 ; position of the laser DX = -5 DY = -17 [AI3_Default] ;Tactic = Direct ;Weapon = Narrow Weapon_Range = 55 Special = No_Front Special2 = Feild ;Special3 = Precedence Special3 = Defense SpecialFreq = 3 Special_Range = 4.0 [Names] NumNames = 3 CaptName1 = Ben CaptName2 = Grod CaptName3 = Jerry --- NEW FILE: shpastba.dat --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shpastba.ini --- [Info] TWCost = 15 Name1 = Astromorph: Name2 = Basilisk Origin = TW Coders = JadtheGerbil Code = AstromorphBasilisk [Ship] Crew = 2 CrewMax = 2 Batt = 8 BattMax = 8 SpeedMax = 50 CruiseMax = 0 AccelRate = 5 TurnRate = 2 RechargeAmount = 1 RechargeRate = 8 WeaponDrain = 3 WeaponRate = 10 SpecialDrain = 6 SpecialRate = 5 HotspotRate = 0 Mass = 5 ; regrowth in seconds, set below 0 to turn off RegrowTime = 2 RegrowDrain = 4 SlitherFriction = 0.0 ;0.00001 ; determines how often it changes direction ; lower = faster, in frames SlitherTime = 10 ; a factor to aid in the above equation SlitherAmount = 2.0 ; how much acceleration is applied laterally while slithering SlitherRate = 5 [Weapon] ;Color = 10 AimRange = 10 AimAngleMax = 15 TargetedSpeedBonus = 1.75 Range = 13 Velocity = 50 Damage = 3 Armor = 1 Poison = 0.3 PoisonDuration = 10000 [Special] WhipSpeed = 170 FlashDamage = 2 FlashTime = 1.25 Links = 12 LinkMass = 3 LinkDistance = 30 LinkHealth = 2 [AI3_Default] Special_Range = 0 Weapon = Hold Weapon2 = Narrow Special = Defense Special2 = Proximity --- NEW FILE: shpastba.txt --- Astromorph: Basilisk A snake-like ship/creature Primary: HELD: Activates a homing-helper laser. RELEASED: Fires a poison blast; Slight speed boost and aiming help if locked on. Secondary: Hurtifies the coils, a combination shield/contact weapon. Also, if holding left/right/forward, will flick the ship in that direction Quirk: * Coils are the health unit, each coil can absorb 1 point of damage before it is destroyed * When battery is full and no weapons fired, the ship will heal coils automatically at a slow rate --- NEW FILE: shpgeror.dat --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shpgeror.ini --- [Info] SC1Cost = 10 SC2Cost = 10 TWCost = 10 Name1 = Gerbillian Name2 = Orion Origin = TW OriginalIdea = Baltar2002 Coders = JadtheGerbil Code = JadOrion [Ship] Crew = 18 CrewMax = 18 Batt = 10 BattMax = 10 TurnRate = 3 SpeedMax = 8 AccelRate = 35 RechargeAmount = 1 RechargeRate = 5 WeaponDrain = 6 WeaponRate = 10 SpecialDrain = 5 SpecialRate = 5 HotspotRate = 7 Mass = 17 [Weapon] Velocity1 = 4.0 Damage1 = 1 Damage2 = 1 Armour1 = 1 Armour2 = 1 ReleaseAngle1 = 70 ReleaseAngle2 = 290 AngleIncrement = 10 FramesToIgnition = 200 FramesOfThrust = 600 FramesOfCoasting = 1050 AccelRate = 15 MaxSpeed = 75 HotspotRate = 0.5 Mass = 2 OrderedIgnition = 0 ;OrderedIgnition is if the missles fire ; in the order they were fired (1) ; or all at once (0) Wiggle = 1 ;Wiggle controls if the missles "wiggle" in space ; 1 on / 0 off [Special] ; actually, TBS is +5 fast ; due to distance TopBoostSpeed = 70 ExplodeDist = 2 Velocity = 20 Lifetime = 1 BlastRange = 6 Damage = 5 Armour = 3 Kick = 60 SafeAngle = 50 [AI3_Default] Weapon = Forward Weapon_Range = 30 Special = Defense Special2 = Mine Special3= Launched SpecialFreq = 2 --- NEW FILE: shpgeror.txt --- Gerbillian Orion: Adapted from an idea by Baltar. A very primitive nuclear-driven rocket. Primary: Fires side-launched rockets. Special: Releases a thrust-bomb. The large shield on the back protects you from it, but only up to a certain angle (~50 to either side). Just pressing it releases it at a pre-determined distance, but it can be held for longer. Quirk: Rotational momentum, thrusters on either side turn the ship. TO DO: * Fix the particle effects so they're parted by your shield. * Add Damage SFX when you take damage from the thrust-bomb * Fix the side-jets (new art), and on each side --- NEW FILE: shpgerra.dat --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shpgerra.ini --- [Info] TWCost = 27 Name1 = Gerbillian Name2 = Racer [Mini-game] Origin = TWs Coders = Jad Code = JadRacer [Ship] Crew = 2 CrewMax = 2 SpeedPanelMax =48 Batt = 0 BattMax = 0 SpeedMax = 0 TachPanelMax = 48 AccelRate = 0.6 TurnRate = 4 RechargeAmount = 0 RechargeRate = 0 WeaponDrain = 0 WeaponRate = 20 SpecialDrain = 0 SpecialRate = 20 HotspotRate = 1 Mass = 1 ;Movement mode. ; 2 handles like some bastard child of 1 and 0 ; 1 handles like a car ; 0 handles like every other Plain Jane ship in TW ThrustMode = 1 ;ideally, used to offset acceleration formula from 0 ;currently, the constant acceleration speed ;Constant = 0.025 Constant = 1 ; what percentage of tachometer to allow shifting ; to disable, set Upshift to 0, Downshift to 1 UpshiftOK = 0.75 DownshiftOK = 0.25 MaxSpeed(0) = 20 MaxSpeed(1) = 35 MaxSpeed(2) = 50 MaxSpeed(3) = 65 MaxSpeed(4) = 80 ; soon to be replaced just by "idle speed" MinSpeed(0) = 5 MinSpeed(1) = 21 MinSpeed(2) = 36 MinSpeed(3) = 51 MinSpeed(4) = 66 Drift = 0.00025 ; Hyperspace melee's constant is... too strong ;Drift = 0.0006 ShiftDelay = 10 swingDecline = 0.08 --- NEW FILE: shpgerra.txt --- Gerbillian Racer [MINI-GAME] Idea by Baltar A mini-game ship. Primary: Shift UP in "gear" Secondary: Shift DOWN in "gear" Currently, the cool custom gauges I had aren't working, and, according to Baltar, the physics aren't "what he wanted" --- NEW FILE: shpsefn2.dat --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shpsefn2.ini --- [Info] Origin = TWa SC1Cost = 10 SC2Cost = 10 TWCost = 10 Name1 = Sefy Name2 = Nautilus 2.0 Coders = GeomanNL-Jad Code = SefyNautilus2 [Ship] Crew = 16 CrewMax = 16 Batt = 20 BattMax = 20 ; even slower than a vux: SpeedMax = 25 AccelRate = 3 TurnRate = 2.0 RechargeAmount = 1 RechargeRate = 5 WeaponDrain = 1 WeaponRate = 1 SpecialDrain = 3 SpecialRate = 15 HotspotRate = 1 Mass = 10 [Weapon] MaxDamage = 1 MinDamage = 1 [Arms] ArmMaxAngle = 100 ; in degree OpenArmTime = 1.0 ; in seconds SnapArmTime = 0.13 ; difference between the two determines the number of snaps you'll get [Special] RelVelocity = 1.0 ; how long it exists, in seconds LifeTime = 30.0 ; delay for unrolling 1 node of the rope (50 nodes for full length) ;Delay = 0.25 Delay = 0.10 OscFreq = 25.0 SegLength = 0.1 ; no problem if this is small Armour = 5.0 ;SprConst = 500.0 SprConst = 650.0 SnagAsteroids = 1 ;250.0 [AI3_Default] Weapon = Missile Special = Attack SpecialFreq = 3 [Names] NumNames = 16 CaptName1 = Archi CaptName2 = Melio CaptName3 = Sanary CaptName4 = Sentinel CaptName5 = Bluob CaptName6 = Squidy CaptName7 = Teril CaptName8 = Mollus CaptName9 = Lonsi CaptName10 = Nutal CaptName11 = Beval CaptName12 = Ofcina CaptName13 = Cephalo CaptName14 = Loli CaptName15 = Peal CaptName16 = Oopse |
From: <geo...@us...> - 2004-02-26 21:41:40
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1574 Added Files: shpalhha.cpp shpastba.cpp shpgeror.cpp shpgerra.cpp shpsefn2.cpp Log Message: adding some of Jads ships --- NEW FILE: shpalhha.cpp --- #include "../ship.h" #include "../melee/mview.h" REGISTER_FILE // combine Klisru main and Alhordian special into this ship ... // also make special more useful by giving more control over it. class AlhordianLaserSweep; class AlhordianHalo : public Ship { public: AlhordianLaserSweep* ALS1; AlhordianLaserSweep* ALS2; int currentSweepTime; int sweepIsOn; double weaponStartVelocity; double weaponStartDamage; double weaponEndDamage; double weaponStartArmour; double weaponEndArmour; double weaponRelativity; double weaponStartFriction; double weaponEndFriction; int weaponLifetime; /* double flashAngle1, flashRange1, flashDamage1; double flashAngle2, flashRange2, flashDamage2; double flashAngle3, flashRange3, flashDamage3; double flashAngle4, flashRange4, flashDamage4; double flashAngle5, flashRange5, flashDamage5; double flashAngle6, flashRange6, flashDamage6; double flashAngle7, flashRange7, flashDamage7; int flashColor;*/ // double specialStartX, specialStartY; // double specialEndX, specialEndY; double specialStartAngle, specialEndAngle; double specialStartRange, specialEndRange; //double specialStartLength, specialEndLength; double specialTime; double specialDamage; int specialSustain; double specialCoolTime, cool_time; double specialFiringRate, firing_time; double sweepFactor; // added by Jad double laser_angle; Vector2 rP1, rP2; public: AlhordianHalo(Vector2 opos, double angle, ShipData *data, unsigned int code); ~AlhordianHalo(void); protected: virtual int activate_weapon(); virtual int activate_special(); virtual void calculate(); void weapon_flash(); void calculate_laser_sweep(); virtual void animate(Frame *f); }; class AlhordianTorp : public Shot { public: AlhordianTorp(AlhordianHalo* ocreator, Vector2 rpos, double oangle, double oStartVelocity, double oEndVelocity, double oStartDamage, double oEndDamage, double orange, double oStartArmour, double oEndArmour, SpaceLocation* opos, SpaceSprite* osprite, double orelativity); AlhordianHalo* creator; double startDamage; double endDamage; double startArmour; double endArmour; double startVelocity; double endVelocity; double lifetimeCounter; double lifetimeMax; double startFriction, endFriction; double friction; virtual void calculate(void); void inflict_damage(SpaceObject *other); }; AlhordianHalo::AlhordianHalo(Vector2 opos, double angle, ShipData *data, unsigned int code) : Ship(opos, angle, data, code) { weaponStartVelocity = scale_velocity(get_config_float("Weapon", "StartVelocity", 0)); weaponStartDamage = get_config_float("Weapon", "StartDamage", 0); weaponStartArmour = get_config_float("Weapon", "StartArmour", 0); weaponEndDamage = get_config_float("Weapon", "EndDamage", 0); weaponEndArmour = get_config_float("Weapon", "EndArmour", 0); weaponRelativity = get_config_float("Weapon", "Relativity", 0); weaponStartFriction = get_config_float("Weapon", "StartFriction", 0); weaponEndFriction = get_config_float("Weapon", "EndFriction", 0); weaponLifetime = get_config_int("Weapon", "Lifetime", 0); /* flashColor = get_config_int("Flash", "Color", 7); flashAngle1 = get_config_float("Flash", "Angle1", 0) * ANGLE_RATIO; flashRange1 = scale_range(get_config_float("Flash", "Range1", 0)); flashAngle2 = get_config_float("Flash", "Angle2", 0) * ANGLE_RATIO; flashRange2 = scale_range(get_config_float("Flash", "Range2", 0)); flashAngle3 = get_config_float("Flash", "Angle3", 0) * ANGLE_RATIO; flashRange3 = scale_range(get_config_float("Flash", "Range3", 0)); flashAngle4 = get_config_float("Flash", "Angle4", 0) * ANGLE_RATIO; flashRange4 = scale_range(get_config_float("Flash", "Range4", 0)); flashAngle5 = get_config_float("Flash", "Angle5", 0) * ANGLE_RATIO; flashRange5 = scale_range(get_config_float("Flash", "Range5", 0)); flashAngle6 = get_config_float("Flash", "Angle6", 0) * ANGLE_RATIO; flashRange6 = scale_range(get_config_float("Flash", "Range6", 0)); flashAngle7 = get_config_float("Flash", "Angle7", 0) * ANGLE_RATIO; flashRange7 = scale_range(get_config_float("Flash", "Range7", 0)); flashDamage1 = get_config_int("Flash", "Damage1", 0); flashDamage2 = get_config_int("Flash", "Damage2", 0); flashDamage3 = get_config_int("Flash", "Damage3", 0); flashDamage4 = get_config_int("Flash", "Damage4", 0); flashDamage5 = get_config_int("Flash", "Damage5", 0); flashDamage6 = get_config_int("Flash", "Damage6", 0); flashDamage7 = get_config_int("Flash", "Damage7", 0);*/ specialStartAngle = get_config_float("Special", "StartAngle", 0) * ANGLE_RATIO; specialEndAngle = get_config_float("Special", "EndAngle", 0) * ANGLE_RATIO; specialStartRange = scale_range(get_config_float("Special", "StartRange", 0)); specialEndRange = scale_range(get_config_float("Special", "EndRange", 0)); specialTime = get_config_int("Special", "Time", 0); specialDamage = get_config_int("Special", "Damage", 0); specialSustain = get_config_int("Special", "Sustain", 0); specialCoolTime = scale_frames(get_config_float("Special", "CoolTime",0)); cool_time = 0; specialFiringRate = scale_frames(get_config_float("Special", "FiringRate",0)); firing_time = 0; sweepFactor = get_config_float("Special", "Factor",0); //currentSweepTime = (int)specialTime + 1; currentSweepTime = 0; //pulling up on sweepIsOn = FALSE; laser_angle = specialStartAngle; int dx, dy; dx = get_config_int("Special", "DX", -5); dy = get_config_int("Special", "DY", -5); rP1 = Vector2(dx, dy); rP2 = Vector2(dx, -dy); // rP1 = Vector2(-5, -17); // rP2 = Vector2(-5, 17); } AlhordianHalo::~AlhordianHalo(void) { ; } void AlhordianHalo::calculate() { STACKTRACE; // if(this->batt<1 || !fire_special) { // //currentSweepTime = 0; //pulling up on // sweepIsOn = FALSE; // } Ship::calculate(); if (sweepIsOn) { if (fire_special && this->batt - special_drain >= 0) { currentSweepTime += frame_time * sweepFactor; game->play_sound(data->sampleWeapon[0],this,255,900 + 1500 * (currentSweepTime / specialTime)); } else { currentSweepTime -= frame_time * sweepFactor; game->play_sound(data->sampleSpecial[0],this,255,900 + 1500 * (currentSweepTime / specialTime)); } /* if (!fire_weapon && fire_special) currentSweepTime += frame_time; else if (fire_weapon && fire_special) currentSweepTime -= frame_time;*/ calculate_laser_sweep(); } cool_time -= frame_time; } int AlhordianHalo::activate_weapon() { STACKTRACE; // if (fire_special) // return false; AlhordianTorp* KT; KT = new AlhordianTorp(this, Vector2(0, size.y * 0.4), this->angle, this->weaponStartVelocity, this->weaponStartVelocity, this->weaponStartDamage, this->weaponEndDamage, -1, this->weaponStartArmour, this->weaponEndArmour, this, this->data->spriteWeapon, 0.0); KT->startFriction = this->weaponStartFriction; KT->endFriction = this->weaponEndFriction; KT->lifetimeCounter = 0; KT->lifetimeMax = this->weaponLifetime; game->add(KT); this->weapon_flash(); return(TRUE); } int AlhordianHalo::activate_special() { STACKTRACE; if(cool_time <= 0) { sweepIsOn = TRUE; return(Ship::activate_special()); } else return(FALSE); // calculate_laser_sweep(); // return(TRUE); } void AlhordianHalo::weapon_flash() { /* STACKTRACE game->add(new Laser(this, angle+flashAngle1, pallete_color[flashColor], flashRange1, flashDamage1, 50, this, Vector2(size.y *0.0, size.y*0.5))); game->add(new Laser(this, angle-flashAngle1, pallete_color[flashColor], flashRange1, flashDamage1, 50, this, Vector2(size.y *0.0, size.y*0.5))); game->add(new Laser(this, angle+flashAngle2, pallete_color[flashColor], flashRange2, flashDamage2, 50, this, Vector2(size.y *0.0, size.y*0.5))); game->add(new Laser(this, angle-flashAngle2, pallete_color[flashColor], flashRange2, flashDamage2, 50, this, Vector2(size.y *0.0, size.y*0.5))); game->add(new Laser(this, angle+flashAngle3, pallete_color[flashColor], flashRange3, flashDamage3, 50, this, Vector2(size.y *0.0, size.y*0.5))); game->add(new Laser(this, angle-flashAngle3, pallete_color[flashColor], flashRange3, flashDamage3, 50, this, Vector2(size.y *0.0, size.y*0.5))); game->add(new Laser(this, angle+flashAngle4, pallete_color[flashColor], flashRange4, flashDamage4, 50, this, Vector2(size.y *0.0, size.y*0.5))); game->add(new Laser(this, angle-flashAngle4, pallete_color[flashColor], flashRange4, flashDamage4, 50, this, Vector2(size.y *0.0, size.y*0.5))); game->add(new Laser(this, angle+flashAngle5, pallete_color[flashColor], flashRange5, flashDamage5, 50, this, Vector2(size.y *0.0, size.y*0.5))); game->add(new Laser(this, angle-flashAngle5, pallete_color[flashColor], flashRange5, flashDamage5, 50, this, Vector2(size.y *0.0, size.y*0.5))); game->add(new Laser(this, angle+flashAngle6, pallete_color[flashColor], flashRange6, flashDamage6, 50, this, Vector2(size.y *0.0, size.y*0.5))); game->add(new Laser(this, angle-flashAngle6, pallete_color[flashColor], flashRange6, flashDamage6, 50, this, Vector2(size.y *0.0, size.y*0.5))); game->add(new Laser(this, angle+flashAngle7, pallete_color[flashColor], flashRange7, flashDamage7, 50, this, Vector2(size.y *0.0, size.y*0.5))); game->add(new Laser(this, angle-flashAngle7, pallete_color[flashColor], flashRange7, flashDamage7, 50, this, Vector2(size.y *0.0, size.y*0.5)));*/ } void AlhordianHalo::calculate_laser_sweep(void) { STACKTRACE; double fractionDone; // double X, Y, double Angle, Length; if ( currentSweepTime < 0 ) currentSweepTime = 0; if ( currentSweepTime > specialTime ) currentSweepTime = (int)specialTime; if ( currentSweepTime > specialTime || currentSweepTime <= 0) // if ( currentSweepTime > specialTime ) { // play a quick, silent sound to cancel out the hum cool_time = specialCoolTime; game->play_sound(data->sampleSpecial[0],this,1,3000); sweepIsOn = FALSE; return; } fractionDone = currentSweepTime / specialTime; // X = specialStartX * (1-fractionDone) + specialEndX * fractionDone; // Y = specialStartY * (1-fractionDone) + specialEndY * fractionDone; Angle = specialStartAngle * (1-fractionDone) + specialEndAngle * (fractionDone); Length = specialStartRange * (1-fractionDone) + specialEndRange * (fractionDone); laser_angle = Angle; firing_time -= frame_time; if(specialFiringRate == 0 || firing_time <= 0) { Vector2 rP; rP = rotate(rP2, PI/2); game->add(new Laser(this,Angle+angle, palette_color[9], Length, specialDamage, specialSustain, this, rP /*Vector2(size.y * X, size.y * Y)*/, TRUE)); rP = rotate(rP1, PI/2); game->add(new Laser(this,-Angle+angle, palette_color[9], Length, specialDamage, specialSustain, this, rP/*Vector2(-size.y * X, size.y * Y)*/, TRUE)); firing_time = specialFiringRate; } } AlhordianTorp::AlhordianTorp(AlhordianHalo* ocreator, Vector2 rpos, double oangle, double oStartVelocity, double oEndVelocity, double oStartDamage, double oEndDamage, double orange, double oStartArmour, double oEndArmour, SpaceLocation* opos, SpaceSprite* osprite, double orelativity) : Shot(ocreator, rpos, oangle, oStartVelocity, oStartDamage, orange, oStartArmour, ocreator, ocreator->data->spriteWeapon, orelativity) { this->explosionSprite = ocreator->data->spriteWeapon; this->explosionFrameCount = 24; creator = ocreator; startDamage = oStartDamage; endDamage = oEndDamage; startArmour = oStartArmour; endArmour = oEndArmour; startVelocity = oStartVelocity; endVelocity = oEndVelocity; sprite_index = 0; this->lifetimeCounter = 0; } void AlhordianTorp::calculate(void) { STACKTRACE; double fractionDone = 0.0; int spriteToUse = 0; Shot::calculate(); d = -1; // to override shot-range lifetimeCounter += frame_time; fractionDone = lifetimeCounter / lifetimeMax; friction = startFriction * (1 - fractionDone) + endFriction * fractionDone; if(fractionDone<0) fractionDone = 0.0; if(fractionDone>=0.999) { fractionDone = 0.999; state = 0; } spriteToUse = (int)(fractionDone * 16.0); sprite_index = spriteToUse; damage_factor = (1 - fractionDone) * startDamage + fractionDone * endDamage; armour = (1 - fractionDone) * startArmour + fractionDone * endArmour; this->v *= (1 - this->friction * frame_time); this->vel = unit_vector(this->angle) * this->v; } void AlhordianTorp::inflict_damage(SpaceObject *other) { STACKTRACE; int x = this->sprite_index; Shot::inflict_damage(other); if (other->mass <= 0) return; if(other->isShip()) game->add(new FixedAnimation(this, other, explosionSprite, x, explosionFrameCount - x, explosionFrameSize, DEPTH_EXPLOSIONS) ); else game->add(new Animation(this, pos, explosionSprite, x, explosionFrameCount - x, explosionFrameSize, DEPTH_EXPLOSIONS) ); } void AlhordianHalo::animate(Frame *f) { Ship::animate(f); int laser_index; Vector2 P; P = pos + rotate(rP1, angle); laser_index = get_index(angle + laser_angle); data->spriteExtra->animate(P, laser_index, f); P = pos + rotate(rP2, angle); laser_index = get_index(angle - laser_angle); data->spriteExtra->animate(P, laser_index, f); } REGISTER_SHIP (AlhordianHalo) --- NEW FILE: shpastba.cpp --- #include <stdio.h> #include "../ship.h" #include "../melee/mview.h" #include "../util/aastr.h" #include "../frame.h" #include "../melee.h" //#include "Seg.h" REGISTER_FILE #define BASILISK_POISON_ID 0x1122 inline double sqr(double x) { return x*x; } // *************************************************************************** [...1328 lines suppressed...] if (chance < frame_time * poison) { play_sound(data->sampleExtra[2]); damage(oship, 0, 1); } } return; } // *************************************************************************** void BasiliskPoison::animate(Frame *space) { } REGISTER_SHIP(AstromorphBasilisk) --- NEW FILE: shpgeror.cpp --- #include "../ship.h" #include "../melee/mview.h" #include "../frame.h" REGISTER_FILE class JadWarhead; class JadOrion : public Ship { double weaponRange; double weaponVelocity1; double weaponMaxSpeed; int weaponDamage1; int weaponDamage2; int weaponArmour1; int weaponArmour2; double weaponRelativity; int weaponFramesToIgnition; int weaponFramesOfThrust; int weaponFramesOfCoasting; double weaponAcceleration; double weaponReleaseAngle1; double weaponReleaseAngle2; double weaponHotspotRate; double weaponMass; double weaponAngleIncrement; int weaponAllLaunch; bool bWiggle; int bombLifetime; double bombDamage, bombArmour; double bombBlastRange, bombKick, bombVelocity, boost_max; double bombExplodeDist; double safeAngle; JadWarhead* bomb; public: JadOrion(Vector2 opos, double angle, ShipData *data, unsigned int code); virtual int activate_weapon(); virtual int activate_special(); virtual void calculate(); }; // *********************************************** /* The Koanua Missle */ class OrionMissile : public Missile { private: bool isBurning; bool isCoasting; int side; double period, rotatetime, accel; double offset; double hotspot_frame; public: OrionMissile(Vector2 opos, double oangle, double ov, int odamage, double orange, int oarmour, Ship *oship, SpaceSprite *osprite, int side, bool bWiggle); Ship* creator; bool bWiggle; double hotspot_rate; double facingAngle; double framesToIgnition; double acceleration; double mass; double ignitionSpeed; double framesOfBurn; double framesOfCoasting; double maxSpeed; double damageAfterIgnition; double armourAfterIgnition; void calculate(void); }; // *********************************************** class JadWarheadExplosion : public Presence { protected: Vector2 *xp, *xv; int num, lifetime, life_counter, color; public: JadWarheadExplosion(); JadWarheadExplosion(Vector2 opos, double ov, int onum, int olife, int ocolor); virtual void calculate(); virtual void animate(Frame *space); virtual ~JadWarheadExplosion(); }; // *********************************************** class JadWarheadExplosion2 : public JadWarheadExplosion { public: JadWarheadExplosion2(Vector2 opos, double ov, int onum, int olife, int ocolor, SpaceObject* otarg); }; // *********************************************** class JadWarhead : public Missile { double blast_range, old_range, kick; double blast_damage, lifetime, boost_max; double safe_range; double safeAngle; double hotspot_rate; SpaceLocation* myShip; bool active; public: JadWarhead (SpaceLocation *creator, Vector2 rpos, double ov, double oangle, double odamage, double oarmour, SpaceSprite *osprite, double oblast_range, int olifetime, double okick, double oblast_max, double osafeAngle, double osafe_range); virtual void calculate(); virtual void animateExplosion(); }; // *********************************************** JadOrion::JadOrion(Vector2 opos, double shipAngle, ShipData *shipData, unsigned int code) : Ship(opos, shipAngle, shipData, code) { bombLifetime = int(get_config_float("Special", "Lifetime", 0) * 1000); bombDamage = get_config_float("Special", "Damage", 0); bombArmour = get_config_float("Special", "Armour", 0); bombBlastRange = scale_range(get_config_float("Special", "BlastRange", 0)); bombKick = scale_velocity(get_config_float("Special", "Kick", 0)); bombVelocity = scale_velocity(get_config_float("Special", "Velocity", 0)); boost_max = scale_velocity(get_config_float("Special", "TopBoostSpeed", 0)); bombExplodeDist = scale_range(get_config_float("Special", "ExplodeDist",0)); weaponAllLaunch = get_config_int("Weapon", "OrderedIgnition", 0); weaponFramesOfCoasting = get_config_int("Weapon", "FramesOfCoasting", 0); weaponVelocity1 = scale_velocity(get_config_float("Weapon", "Velocity1", 0)); weaponDamage1 = get_config_int("Weapon", "Damage1", 0); weaponArmour1 = get_config_int("Weapon", "Armour1", 0); weaponMaxSpeed = scale_velocity(get_config_float("Weapon", "MaxSpeed", 0)); weaponDamage2 = get_config_int("Weapon", "Damage2", 0); weaponArmour2 = get_config_int("Weapon", "Armour2", 0); weaponHotspotRate = get_config_float("Weapon", "HotspotRate",0); weaponFramesToIgnition = get_config_int("Weapon", "FramesToIgnition", 0); weaponFramesOfThrust = get_config_int("Weapon", "FramesOfThrust", 0); weaponReleaseAngle1 = get_config_float("Weapon", "ReleaseAngle1", 0)*ANGLE_RATIO; weaponReleaseAngle2 = get_config_float("Weapon", "ReleaseAngle2", 0)*ANGLE_RATIO; weaponAcceleration = scale_acceleration(get_config_float("Weapon", "AccelRate",0), weaponHotspotRate); weaponMass = get_config_float("Weapon", "Mass", 0); weaponAngleIncrement = get_config_float("Weapon", "AngleIncrement", 0)*ANGLE_RATIO; bWiggle = bool(get_config_int("Weapon", "Wiggle", 1)); safeAngle = get_config_float("Special", "SafeAngle", 0)*ANGLE_RATIO; bomb = NULL; } // *********************************************** void JadOrion::calculate() { if(bomb && (bomb->state == 0 || !bomb->exists())) bomb = NULL; Ship::calculate(); } // *********************************************** int JadOrion::activate_weapon() { for(int i=1; i < 4; i++) { for(int j=-1; j < 2; j+=2) { OrionMissile* K; double a; a = weaponAngleIncrement*i; if(j == 1) { a = -a; a += weaponReleaseAngle2; } else a += weaponReleaseAngle1; K = new OrionMissile(0, turn_step+angle+ a, weaponVelocity1*i, weaponDamage1, scale_range(1000), weaponArmour1, this, data->spriteWeapon, j, bWiggle); K->hotspot_rate = scale_frames(weaponHotspotRate); K->framesToIgnition = weaponFramesToIgnition * (weaponAllLaunch ? i : 1); K->framesOfBurn = weaponFramesOfThrust; K->framesOfCoasting = weaponFramesOfCoasting; K->facingAngle = angle+turn_step; K->creator =this; K->damageAfterIgnition = weaponDamage2; K->armourAfterIgnition = weaponArmour2; K->acceleration = weaponAcceleration; K->mass = weaponMass; K->maxSpeed = weaponMaxSpeed; game->add(K); } } return(TRUE); } // *********************************************** int JadOrion::activate_special() { if (bomb) return false; add(bomb = new JadWarhead(this, Vector2(0, size.y / -2.0), bombVelocity, angle+PI, bombDamage, bombArmour, data->spriteSpecial, bombBlastRange, bombLifetime, bombKick, boost_max, safeAngle, bombExplodeDist)); return true; } // *********************************************** // TAU BOMBER CODE // *********************************************** JadWarhead::JadWarhead (SpaceLocation *creator, Vector2 rpos, double ov, double oangle, double odamage, double oarmour, SpaceSprite *osprite, double oblast_range, int olifetime, double okick, double oboost_max, double osafeAngle, double osafe_range) : Missile(creator, rpos, oangle, ov, 0, 1e40, oarmour, creator, osprite, 1.0), blast_range(oblast_range), blast_damage(odamage), kick(okick), lifetime(olifetime), active(false), old_range(1e40) { myShip = ship; id = SPACE_SHOT; collide_flag_sameteam = 0; mass = 0.01; boost_max = oboost_max; safeAngle = osafeAngle; safe_range = osafe_range; } // *********************************************** void JadWarhead::calculate() { sprite_index++; sprite_index &= 63; if (ship && distance(ship) > safe_range && (!ship->exists() || !ship->fire_special)) { ship = NULL; active = true; damage(this, 999); } Missile::calculate(); } // *********************************************** void JadWarhead::animateExplosion() { explosionSample = data->sampleSpecial[1]; explosionSprite = data->spriteSpecialExplosion; explosionFrameCount = 10; explosionFrameSize = 50; Query q; double r; int d; Vector2 stuff; for (q.begin(this, OBJECT_LAYERS, blast_range); q.currento; q.next()) { r = distance(q.currento); if (r > blast_range) continue; r = (blast_range - distance(q.currento)) / blast_range; if (r > 0.5) d = (int)ceil(blast_damage * (r - 0.5)); else d = 0; stuff = q.currento->normal_pos(); if(q.currento != myShip || (q.currento == myShip && abs(trajectory_angle(q.currento) - q.currento->get_angle()) > safeAngle)) { //stuff = q.currento->normal_pos()/* + (unit_vector(q.currento->trajectory_angle(this)) * q.currento->get_size()/2.5)*/; add(new JadWarheadExplosion2(stuff, scale_velocity(tw_random()%2+5), 100, 600, makecol(255,128,0), this)); damage(q.currento, (int)ceil(r * blast_damage) - d, d); int i = iround_down(((int)ceil(r * blast_damage)) / 2); if(i >= BOOM_SAMPLES) i = BOOM_SAMPLES - 1; play_sound((SAMPLE *)(melee[MELEE_BOOM + i].dat), 36*r + 220); } else if(q.currento == myShip) { /* + (unit_vector(q.currento->trajectory_angle(this)) * q.currento->get_size()/4)*/; add(new JadWarheadExplosion(stuff, scale_velocity(tw_random()%2+5), 100, 1000, makecol(128,128,255))); } if ((q.currento->mass > 0) && (!q.currento->isPlanet())) q.currento->accelerate(this, trajectory_angle(q.currento), kick * r / ((q.currento->mass > 1)?sqrt(q.currento->mass):1), boost_max); } add(new JadWarheadExplosion(pos, scale_velocity(tw_random()%20+25), 150, 450, makecol(255,128,0))); Missile::animateExplosion(); } // *********************************************** JadWarheadExplosion::JadWarheadExplosion() { } JadWarheadExplosion::JadWarheadExplosion(Vector2 opos, double ov, int onum, int olife, int ocolor) : Presence(), num(onum), lifetime(olife), life_counter(0), color(ocolor) { if (onum <= 0) { state = 0; return; } set_depth(DEPTH_EXPLOSIONS); xp = new Vector2[num]; xv = new Vector2[num]; int i; for (i=0; i<num; i++) { xp[i] = opos; xv[i] = ov * (0.5+sqrt(sqrt((random()%1000000001)/1000000000.0))) * unit_vector(PI2 * (random()%1000000)/1000000.0); } } // *********************************************** void JadWarheadExplosion::calculate() { life_counter += frame_time; if (life_counter >= lifetime) { state = 0; return; } int i; for (i=0; i<num; i++) xp[i] += xv[i] * frame_time; } // *********************************************** void JadWarheadExplosion::animate(Frame *space) { if (state == 0) return; int i, j; double t = 1 - life_counter/(double)lifetime; double x0, y0, dx, dy; int xi, yi; Vector2 p0; drawing_mode(DRAW_MODE_TRANS, NULL, 0, 0); for (i=0; i<num; i++) { p0 = corner(xp[i]); x0 = p0.x; y0 = p0.y; p0 = unit_vector(xv[i]) * 3 * space_zoom; dx = p0.x; dy = p0.y; for (j=3; j>=0; j--) { if (space_zoom <= 1) set_trans_blender(0, 0, 0, space_zoom * 255 * t * (4-j) / 4.0); else set_trans_blender(0, 0, 0, 1 * 255 * t * (4-j) / 4.0); xi = iround(x0 - dx * j); yi = iround(y0 - dy * j); putpixel(space->surface, xi, yi, color); space->add_pixel(xi, yi); } } drawing_mode(DRAW_MODE_SOLID, NULL, 0, 0); } // *********************************************** JadWarheadExplosion::~JadWarheadExplosion() { if (num > 0) { delete xp; delete xv; } } // *********************************************** JadWarheadExplosion2::JadWarheadExplosion2(Vector2 opos, double ov, int onum, int olife, int ocolor, SpaceObject* otarg) { Presence::Presence(); num = onum; lifetime = olife; life_counter = 0; color = ocolor; if (onum <= 0) { state = 0; return; } set_depth(DEPTH_EXPLOSIONS); xp = new Vector2[num]; xv = new Vector2[num]; int i; for (i=0; i<num; i++) { xp[i] = opos; xv[i] = ov * ((0.5+sqrt(sqrt((random()%1000000001)/1000000000.0))) * unit_vector(trajectory_angle(opos, otarg->pos) - PI/2 + (PI * (random()%1000000)/1000000.0))); } } // *********************************************** // KOANUA+VIOGEN MISSILE CODE // *********************************************** OrionMissile::OrionMissile(Vector2 opos, double oangle, double ov, int odamage, double orange, int oarmour, Ship *oship, SpaceSprite *osprite, int oside, bool obWiggle) : Missile(oship, opos, oangle, ov, odamage, orange, oarmour, oship,osprite, 1.0) { bWiggle = obWiggle; side = oside; explosionSprite = data->spriteWeaponExplosion; isBurning = false; isCoasting = false; facingAngle = oangle; hotspot_frame = 0; period = 1.0; rotatetime = 0; accel = scale_acceleration(7); } // *********************************************** void OrionMissile::calculate() { if(!isBurning && !isCoasting) if(framesToIgnition>=0) { framesToIgnition -= frame_time; } else { framesToIgnition = 0; isBurning = true; vel = unit_vector(angle + (PI/2 * side)) / 2; angle = facingAngle; damage_factor = damageAfterIgnition; armour = armourAfterIgnition; range = 99999; play_sound2(data->sampleWeapon[1]); offset = distance(ship); } else { Vector2 normal; normal = Vector2(-vel.y, vel.x); normalize(normal); rotatetime += frame_time * 1E-3; if(bWiggle) { double a; a = sin(PI2 * rotatetime / period + (PI/2 * side)); vel += (accel*frame_time) * a * normal; angle = vel.atan(); } if (hotspot_frame > 0) hotspot_frame -= frame_time; if(hotspot_frame <= 0) { // release some smoke trail. Vector2 relpos; relpos = Vector2( random(10.0)-5.0, -40.0 + random(10.0) ); Animation *anim; anim = new Animation(this, pos + rotate(relpos, angle-0.5*PI), data->spriteExtra, 0, data->spriteExtra->frames(), 100, LAYER_HOTSPOTS); add(anim); hotspot_frame += hotspot_rate; } } if(isBurning && !isCoasting) { if(framesOfBurn>=0) { framesOfBurn -= frame_time; accelerate_gravwhip (this, facingAngle, /*acceleration / mass*/ acceleration * frame_time, maxSpeed); } else { framesOfBurn = 0; isBurning = false; isCoasting = true; } } else if(isCoasting) { framesOfCoasting -= frame_time; if(framesOfCoasting<=0) state=0; } sprite_index = (get_index(facingAngle) + (int(isBurning) * 64)); Missile::calculate(); } REGISTER_SHIP ( JadOrion ) --- NEW FILE: shpgerra.cpp --- #include "../ship.h" #include "../melee/mview.h" REGISTER_FILE #define GEARS 5 class JadRacer : public Ship { public: JadRacer(Vector2 opos, double angle, ShipData *data, unsigned int code); private: double gearMaxSpeed[GEARS]; double gearMinSpeed[GEARS]; int curGear; double getAccel(double step); // for non-linear acceleration double getBrake(double step); // for non-linear braking double drift_rate; double shift_rate, shift_frame; double constant; double cur_gear_rel; double cur_speed_real; double cur_speed_rel; double upshiftOK; double downshiftOK; double thrust_angle; double swingDecline; Vector2 swingVec; bool hotspot_index, bChangeSpeed, bChangeTach, bAngle; int extra_hotspot_frame, extra_hotspot_rate; int speed, speedMax, last_pitch, thrustMode; int tach, tachMax; void calculate(); void calculate_thrust(); void calculate_turn_left(); void calculate_turn_right(); void calculate_hotspots(); void animate(Frame *space); int activate_weapon(); int activate_special(); bool custom_panel_update(BITMAP* panel, int display_type); }; JadRacer::JadRacer(Vector2 opos, double angle, ShipData *data, unsigned int code) : Ship(opos, angle, data, code) { /* int i; char *curRead; for(i = 0; i < GEARS;i++) { curRead = "MaxSpeed(#)"; curRead[9] = char(i+48); gearMaxSpeed[i] = scale_velocity(get_config_float("Ship", curRead, 0)); curRead = "MinSpeed(#)"; curRead[9] = char(i+48); gearMinSpeed[i] = scale_velocity(get_config_float("Ship", curRead, 0)); } */ gearMaxSpeed[0] = scale_velocity(get_config_float("Ship", "MaxSpeed(0)", 0)); gearMaxSpeed[1] = scale_velocity(get_config_float("Ship", "MaxSpeed(1)", 0)); gearMaxSpeed[2] = scale_velocity(get_config_float("Ship", "MaxSpeed(2)", 0)); gearMaxSpeed[3] = scale_velocity(get_config_float("Ship", "MaxSpeed(3)", 0)); gearMaxSpeed[4] = scale_velocity(get_config_float("Ship", "MaxSpeed(4)", 0)); gearMinSpeed[0] = scale_velocity(get_config_float("Ship", "MinSpeed(0)", 0)); gearMinSpeed[1] = scale_velocity(get_config_float("Ship", "MinSpeed(1)", 0)); gearMinSpeed[2] = scale_velocity(get_config_float("Ship", "MinSpeed(2)", 0)); gearMinSpeed[3] = scale_velocity(get_config_float("Ship", "MinSpeed(3)", 0)); gearMinSpeed[4] = scale_velocity(get_config_float("Ship", "MinSpeed(4)", 0)); drift_rate = get_config_float("Ship", "Drift", 0); shift_rate = scale_frames(get_config_float("Ship", "ShiftDelay",0)); shift_frame = 0; constant = get_config_float("Ship", "Constant", 0); upshiftOK = get_config_float("Ship", "UpshiftOK",0); downshiftOK = get_config_float("Ship", "DownshiftOK",0); speedMax = get_config_int("Ship", "SpeedPanelMax", 0); tachMax = get_config_int("Ship", "TachPanelMax", 0); thrustMode = get_config_int("Ship", "ThrustMode", 0); swingDecline = get_config_float("Ship", "swingDecline", 0); tach = 0; speed = 0; curGear = 0; cur_gear_rel = 0; cur_speed_real = 0; last_pitch = 0; swingVec = vel; thrust_angle = angle; hotspot_index = true; extra_hotspot_rate = 25; extra_hotspot_frame = 0; bChangeSpeed = true; bChangeTach = true; bAngle = false; } void JadRacer::animate(Frame *space) { sprite->animate(pos, sprite_index + (64*int(thrust_backwards)), space); } void JadRacer::calculate_turn_left() { if(turn_left) bAngle = true; Ship::calculate_turn_left(); } void JadRacer::calculate_turn_right() { if(turn_right) bAngle = true; Ship::calculate_turn_right(); } void JadRacer::calculate() { // double diff; if(shift_frame > 0) shift_frame -= frame_time; if(!(thrust_backwards && thrust) && thrustMode > 0) thrust_angle = angle; //--> diff = fabs(vel.angle() - angle); //--> if(diff > 0.001) // swingVec = (vel + (unit_vector(angle) * cur_speed_real))/2.0; // if(bAngle) // { //--> swingVec *= 1 - swingDecline; // swingVec = unit_vector((swingVec.angle()+angle)/2) * swingVec.magnitude(); // if(swingVec.magnitude() < 0.001) // bAngle = false; // } // if(!bAngle) // { // swingVec = vel; // } game->add(new Laser(this, vel.angle(), makecol(255,255,255), magnitude(vel)*80, 0, 1, this, Vector2(size.x/-10,size.y/2))); if(thrustMode > 0) { // cur_speed_real *= exp(drift_rate*frame_time); if(shift_frame <= 0 && !thrust) cur_speed_real *= 1 - fabs(drift_rate) * frame_time; if(cur_speed_real < gearMinSpeed[curGear]) { cur_speed_real += getAccel(cur_speed_real / gearMinSpeed[curGear])*accel_rate*frame_time; } if(cur_speed_real < gearMinSpeed[0]) { cur_speed_real += getAccel(cur_speed_real / gearMinSpeed[0])*accel_rate*frame_time; } } else { // vel *= exp(drift_rate*frame_time); if(shift_frame <= 0 && !thrust) vel *= 1 - fabs(drift_rate) * frame_time; cur_speed_real = dot_product(vel, unit_vector(vel)); } // cur_speed_rel = (cur_speed_real -gearMinSpeed[0]) / (gearMaxSpeed[GEARS-1]-gearMinSpeed[0]); cur_speed_rel = cur_speed_real / gearMaxSpeed[GEARS-1]; cur_gear_rel = (cur_speed_real-gearMinSpeed[curGear]) / (gearMaxSpeed[curGear]-gearMinSpeed[curGear]); // cur_gear_rel = (cur_speed_real-gearMinSpeed[0] ) / (gearMaxSpeed[curGear]-gearMinSpeed[0]); // cur_gear_rel = cur_speed_real / gearMaxSpeed[curGear]; Ship::calculate(); if(speed != ceil(cur_speed_rel * speedMax)) { speed = ceil(cur_speed_rel * speedMax); bChangeSpeed = true; ship->update_panel = TRUE; } if(speed < 0) speed = 0; if(tach != ceil(cur_gear_rel * tachMax)) { tach = ceil(cur_gear_rel * tachMax); bChangeTach = true; ship->update_panel = TRUE; } if(tach < 0) tach = 0; if(shift_frame > 0) { last_pitch = 2000+6500*fabs((frame_time/(shift_frame-shift_rate))-0.5); // last_pitch=99999999; } else // last_pitch = 1000+2000*(cur_gear_rel+0.01); last_pitch = 2000+6500*(cur_speed_rel+0.01); play_sound2(data->sampleExtra[0],255,last_pitch); if(!(thrust_backwards && thrust) && thrustMode == 1) vel = cur_speed_real * unit_vector(thrust_angle); // if(thrustMode == 2) // { //game->add(new Laser(this, swingVec.angle(), makecol(255,0,0), swingVec.magnitude()*80, 0, 1, this, Vector2(size.x/10,size.y/2))); // vel = cur_speed_real * unit_vector((thrust_angle+swingVec.angle())/2); // if(bAngle) // vel += swingVec; // } } void JadRacer::calculate_thrust() { double new_speed = (getAccel(cur_gear_rel)*accel_rate*frame_time)/(1-fabs(drift_rate)*frame_time); // double new_speed = getAccel(cur_gear_rel)*accel_rate*frame_time*exp(-drift_rate*frame_time); // double new_speed = getAccel(cur_gear_rel)*accel_rate*frame_time; // double new_speed = getAccel(cur_speed_rel)*accel_rate*frame_time; if(shift_frame <= 0) { if(thrustMode == 1) { game->add(new Laser(this, thrust_angle, makecol(255,0,0), new_speed*80, 0, 1, this, Vector2(size.x/10,size.y/2))); if(thrust && ((cur_speed_real + new_speed) <= gearMaxSpeed[curGear])) cur_speed_real += new_speed; if(thrust_backwards) { new_speed = getBrake(cur_gear_rel)*accel_rate*frame_time; if(cur_speed_real - new_speed >= gearMinSpeed[curGear]) cur_speed_real -= new_speed; if(thrust) accelerate_gravwhip(this, angle+PI, new_speed, gearMinSpeed[0]); } } else if(thrustMode == 0) { game->add(new Laser(this, thrust_angle, makecol(255,0,0), new_speed*80, 0, 1, this, Vector2(size.x/10,size.y/2))); if(thrust) accelerate_gravwhip(this, angle, new_speed, gearMaxSpeed[curGear]); else if(thrust_backwards) accelerate_gravwhip(this, angle+PI, getBrake(cur_gear_rel)*accel_rate*frame_time, gearMinSpeed[0]); } else { accelerate_gravwhip(this, angle, vel.magnitude()+new_speed, gearMaxSpeed[curGear]); if(thrust) { if((cur_speed_real + new_speed) <= gearMaxSpeed[curGear]) cur_speed_real += new_speed; } if(thrust_backwards) { new_speed = getBrake(cur_gear_rel)*accel_rate*frame_time; if((cur_speed_real - new_speed) >= gearMinSpeed[curGear]) cur_speed_real -= new_speed; if(thrust) accelerate_gravwhip(this, angle+PI, new_speed, gearMinSpeed[0]); } } } } int JadRacer::activate_weapon() { if(shift_frame <= 0) { if(curGear < GEARS - 1 && cur_gear_rel >= upshiftOK) { curGear++; message.print(1000,10, "Gear is now %i", curGear); shift_frame += shift_rate; return TRUE; } } return FALSE; } int JadRacer::activate_special() { if(shift_frame <= 0) { if(curGear > 0 && cur_gear_rel <= downshiftOK) { curGear--; message.print(1000,10, "Gear is now %i", curGear); shift_frame += shift_rate; return TRUE; } } return FALSE; } double JadRacer::getAccel(double x) { // return pow((x*0.5),2)+constant; // return (x+constant < 1)?x+constant:1; return constant; // return cos(tan(exp(-x))); // return pow((0-x),2); } double JadRacer::getBrake(double x) { // return pow(-x*0.5,5)-constant; return constant; } void JadRacer::calculate_hotspots() { // Ship::calculate_hotspots(); if (extra_hotspot_frame > 0) { extra_hotspot_frame -= frame_time; return; } // if (!thrust || shift_frame > 0) if (shift_frame > 0) return; while (extra_hotspot_frame <= 0) extra_hotspot_frame += extra_hotspot_rate; //* fabs(0.99-cur_gear_rel); hotspot_index = !hotspot_index; int ff = int(ceil(1*cur_gear_rel*20)); // int ff = 19; if (ff == 0) return; else if(ff < 19) ff = 19; double rx, ry; double tx = cos(angle); double ty = sin(angle); int i; for (i=0; i<2; i++) { if (hotspot_index) rx = (i-0.5)*5; else rx = (i-0.5)*10; ry = -22; game->add(new Animation(this, Vector2(pos.x+ry*tx-rx*ty, pos.y+ry*ty+rx*tx), data->spriteExtraExplosion, 20-ff, ff, 25, LAYER_HOTSPOTS)); // e->vx = vx; // e->vy = vy; // e->accelerate(this, angle+PI, scale_velocity(30), GLOBAL_MAXSPEED); } } bool JadRacer::custom_panel_update(BITMAP* panel, int display_type) { int i, bar_x, bar_y; int speed_x, speed_y; int tach_x, tach_y; int col; //if(bChangeSpeed && display_type == 1) { speed_x = 8; speed_y = 53; bar_x = 0; bar_y = 0; for(i = 0; i < speedMax; i++) { BITMAP *bmp = panel; if((i - speed) < 0) { col = makecol(ceil(128*(float(i)/speedMax))+127, ceil(64*(float(i)/speedMax)), ceil(64*(float(i)/speedMax))); putpixel(bmp, speed_x + bar_x, speed_y + bar_y, col); putpixel(bmp, speed_x + bar_x + 1, speed_y + bar_y, col); } else { putpixel(bmp, speed_x + bar_x, speed_y + bar_y, 0); putpixel(bmp, speed_x + bar_x + 1, speed_y + bar_y, 0); } if((i % 2) == 0) bar_x = -3; else { bar_x = 0; bar_y -= 2; } } bChangeSpeed = false; } //if(bChangeTach && display_type != 1) { tach_x = 56; tach_y = 53; bar_x = 0; bar_y = 0; for(i = 0; i < tachMax; i++) { BITMAP *bmp = panel; if((i - tach) < 0) { col = makecol(ceil(255*(float(i)/tachMax)), ceil(255*(1.0-(float(i)/tachMax))), 0); putpixel(bmp, tach_x + bar_x, tach_y + bar_y, col); putpixel(bmp, tach_x + bar_x + 1, tach_y + bar_y, col); } else { putpixel(bmp, tach_x + bar_x, tach_y + bar_y, 0); putpixel(bmp, tach_x + bar_x + 1, tach_y + bar_y, 0); } if((i % 2) == 0) bar_x = -3; else { bar_x = 0; bar_y -= 2; } } bChangeTach = false; } return true; //return false; } REGISTER_SHIP(JadRacer) --- NEW FILE: shpsefn2.cpp --- #include "../ship.h" #include "../frame.h" #include "../melee/mview.h" REGISTER_FILE /* A ship with a harpoon, and a short-range laser. */ class ShipPart2; class ShipPart2Manager; class Hook2; class SefyNautilus2 : public Ship [...1166 lines suppressed...] Vector2 pos2old = ropenode[Nnodes].pos; Vector2 pos1new = pos1old; Vector2 pos2new = ropenode[Nnodes-1].pos; // spread the disappeared distance a little: int i; for ( i = Nnodes-1; i >= 0; --i ) { ropenode[i] = ropenode[i-1]; } */ } // ********************************************************************************* REGISTER_SHIP ( SefyNautilus2 ) |
From: <geo...@us...> - 2004-02-26 21:39:50
|
Update of /cvsroot/timewarp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1149 Modified Files: twwin.dsp Log Message: adding some of Jads ships |
From: <yu...@us...> - 2004-02-26 17:54:23
|
Update of /cvsroot/timewarp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14803 Modified Files: scpwin.ico Log Message: Readded icon, impruved dialogs |
From: <yu...@us...> - 2004-02-26 17:53:57
|
Update of /cvsroot/timewarp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14657 Modified Files: twwin.dsp Log Message: Readded icon, impruved dialogs |
From: <yu...@us...> - 2004-02-26 17:53:57
|
Update of /cvsroot/timewarp/source/games In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14657/source/games Modified Files: ggob.cpp Log Message: Readded icon, impruved dialogs Index: ggob.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/ggob.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ggob.cpp 25 Feb 2004 20:23:51 -0000 1.25 --- ggob.cpp 26 Feb 2004 17:45:51 -0000 1.26 *************** *** 610,615 **** STACKTRACE; ! const int num_enemy_types = 19; ! static char *enemy_types[num_enemy_types] = { "thrto", "zfpst", "shosc", "dragr", "ktesa", "kahbo", "ilwsp", --- 610,615 ---- STACKTRACE; ! ! static char *enemy_types[] = { "thrto", "zfpst", "shosc", "dragr", "ktesa", "kahbo", "ilwsp", *************** *** 619,622 **** --- 619,624 ---- "chmav", "plopl", "narlu" }; + const int num_enemy_types = sizeof(enemy_types)/sizeof(enemy_types[0]); + if (gobenemies == max_enemies) return; |
From: <yu...@us...> - 2004-02-26 17:53:57
|
Update of /cvsroot/timewarp/source/other In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14657/source/other Modified Files: gdialog.cpp Log Message: Readded icon, impruved dialogs Index: gdialog.cpp =================================================================== RCS file: /cvsroot/timewarp/source/other/gdialog.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gdialog.cpp 29 Jan 2004 21:20:30 -0000 1.4 --- gdialog.cpp 26 Feb 2004 17:45:51 -0000 1.5 *************** *** 17,20 **** --- 17,22 ---- #include "../util/aastr.h" + #include <string> + #define gobgame ((GobGame*)game) *************** *** 27,30 **** --- 29,52 ---- static int alien_image_y = 0; + /////////////////////////////////////////////////////////////////////////////////////////// + // Helper functions + /////////////////////////////////////////////////////////////////////////////////////////// + /*! \brief split string by words + \param source string + \chars maximum length of returned string + \return result string + */ + std::string SplitString(std::string source, int chars) + { + std::string strResult; + if (source.length()<chars+1) + return source; + + int size = source.rfind(' ', chars); + source.resize(size+1); + return source; + } + + ////////////////////////////////////////////////////////////////////////////////////////// void InitConversationModule ( lua_State* L ) { *************** *** 113,121 **** const char* text = lua_tostring(ls, 1); ! textout(game->window->surface, font, text, 10, 10, -1); game->window->unlock(); return 0; } int l_DialogAnswer(lua_State* ls) { --- 135,156 ---- const char* text = lua_tostring(ls, 1); ! std::string strText = text; ! std::string strTemp; ! int k = 15; ! while(strText.length() != 0 ) ! { ! std::string strTmp; ! strTemp = SplitString(strText, 60); ! textout(game->window->surface, font, strTemp.c_str(), 10, k, -1); ! strText.erase(strText.begin(), strText.begin() + strTemp.length()); ! k+=15; ! } ! game->window->unlock(); return 0; } + + int l_DialogAnswer(lua_State* ls) { |
From: <yu...@us...> - 2004-02-26 17:53:57
|
Update of /cvsroot/timewarp/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14657/Util Modified Files: timewarp.nsi Log Message: Readded icon, impruved dialogs Index: timewarp.nsi =================================================================== RCS file: /cvsroot/timewarp/Util/timewarp.nsi,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** timewarp.nsi 27 Nov 2003 05:45:39 -0000 1.3 --- timewarp.nsi 26 Feb 2004 17:45:51 -0000 1.4 *************** *** 11,15 **** OutFile timewarp-${VER_VERSION}.${VER_SUBVERSION}u${VER_BUILD}.exe ! SetCompressor bzip2 InstallDir $PROGRAMFILES\TimeWarp --- 11,15 ---- OutFile timewarp-${VER_VERSION}.${VER_SUBVERSION}u${VER_BUILD}.exe ! SetCompressor lzma InstallDir $PROGRAMFILES\TimeWarp |
From: <geo...@us...> - 2004-02-25 20:31:22
|
Update of /cvsroot/timewarp/source/games In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20706/games Modified Files: ggob.cpp Log Message: no message Index: ggob.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/ggob.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ggob.cpp 24 Feb 2004 23:21:54 -0000 1.24 --- ggob.cpp 25 Feb 2004 20:23:51 -0000 1.25 *************** *** 122,125 **** --- 122,136 ---- s->vel = 0; + + + section = "upgrades"; + + // each player keeps track of its own set of upgrades. + // hmm, and what if one of the upgrades gets deleted ? + int i; + for (i = 0; gp->upgrade_list[i]; i += 1) + { + confnum("num", i, gp->upgrade_list[i]->num); + } } *************** *** 340,346 **** for (i = 0; i < 19; i += 1) add(new GobAsteroid()); ! int ichoice = 1; ! ichoice = tw_alert("Continue game?", "&YES", "&NO"); ! // check a menu to see what the player wants ... how ?? if (ichoice == 2) --- 351,361 ---- for (i = 0; i < 19; i += 1) add(new GobAsteroid()); ! ! int ichoice = 2; // default, "no" 'don't load a game ! if (!lag_frames) ! { ! // check a menu to see what the player wants ... how ?? ! ichoice = tw_alert("Continue game?", "&YES", "&NO"); ! } if (ichoice == 2) |
From: <you...@us...> - 2004-02-25 00:26:48
|
Update of /cvsroot/timewarp/source/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2158/source/util Modified Files: sounds.cpp sounds.h Log Message: first attempt to fix bug # 45 (music screwing up when alt-tabbing) Index: sounds.cpp =================================================================== RCS file: /cvsroot/timewarp/source/util/sounds.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sounds.cpp 11 Oct 2003 21:00:58 -0000 1.4 --- sounds.cpp 25 Feb 2004 00:20:02 -0000 1.5 *************** *** 21,45 **** #define MIN_MUSIC_CHANNELS 10 - /*------------------------------ - Sound (and MODs) - ------------------------------*/ - #ifdef NO_JGMOD - static void set_mod_volume(int a) {} - static void play_mod(Music *a, int b) {} - static void stop_mod() {} - static bool is_mod_playing() {return false;} - static void remove_mod() {} - static void install_mod(int a) {} - static void pause_mod() {} - static void resume_mod() {} - static Music *load_mod(const char *fname) {return NULL;} - static void destroy_mod(Music *) {} - # undef MIN_MUSIC_CHANNELS - # undef MAX_MUSIC_CHANNELS - # define MIN_MUSIC_CHANNELS 0 - # define MAX_MUSIC_CHANNELS 0 - #else - #include <jgmod.h> - #endif /* static int is_jgmod_compiled() {return 0;} */ --- 21,24 ---- Index: sounds.h =================================================================== RCS file: /cvsroot/timewarp/source/util/sounds.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sounds.h 10 Jan 2004 22:27:58 -0000 1.4 --- sounds.h 25 Feb 2004 00:20:02 -0000 1.5 *************** *** 13,16 **** --- 13,18 ---- #endif + #include "base.h" + class SoundSystem : public BaseClass { public: *************** *** 55,57 **** --- 57,82 ---- #define sound tw_soundsystem + /*------------------------------ + Sound (and MODs) + ------------------------------*/ + #ifdef NO_JGMOD + static void set_mod_volume(int a) {} + static void play_mod(Music *a, int b) {} + static void stop_mod() {} + static bool is_mod_playing() {return false;} + static void remove_mod() {} + static void install_mod(int a) {} + static void pause_mod() {} + static void resume_mod() {} + static Music *load_mod(const char *fname) {return NULL;} + static void destroy_mod(Music *) {} + # undef MIN_MUSIC_CHANNELS + # undef MAX_MUSIC_CHANNELS + # define MIN_MUSIC_CHANNELS 0 + # define MAX_MUSIC_CHANNELS 0 + #else + #include <jgmod.h> + #endif + + #endif // __SOUNDS_H__ |
From: <you...@us...> - 2004-02-25 00:26:47
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2158/source/melee Modified Files: mhelpers.cpp Log Message: first attempt to fix bug # 45 (music screwing up when alt-tabbing) Index: mhelpers.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mhelpers.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mhelpers.cpp 20 Feb 2004 08:42:44 -0000 1.6 --- mhelpers.cpp 25 Feb 2004 00:20:02 -0000 1.7 *************** *** 3,6 **** --- 3,7 ---- #include <string.h> #include <assert.h> + #include "../util/sounds.h" *************** *** 95,104 **** VideoSystem videosystem; ! /*static void tw_display_switch_out() { ! if (game && !game->is_paused()) { ! game->pause(); ! game->unpause(); ! } ! }*/ static void tw_display_switch_in() { if (get_time() > videosystem.last_poll + 1000) { --- 96,103 ---- VideoSystem videosystem; ! ! static void tw_display_switch_out() { ! pause_mod(); ! } static void tw_display_switch_in() { if (get_time() > videosystem.last_poll + 1000) { *************** *** 106,109 **** --- 105,110 ---- } else videosystem.screen_corrupted = true; + + resume_mod(); } static int _gamma = -1; *************** *** 312,316 **** set_display_switch_mode(SWITCH_BACKGROUND); set_display_switch_callback(SWITCH_IN, tw_display_switch_in); ! // set_display_switch_callback(SWITCH_OUT, tw_display_switch_out); int owidth, oheight, obpp, ogamma, ofullscreen; --- 313,317 ---- set_display_switch_mode(SWITCH_BACKGROUND); set_display_switch_callback(SWITCH_IN, tw_display_switch_in); ! set_display_switch_callback(SWITCH_OUT, tw_display_switch_out); int owidth, oheight, obpp, ogamma, ofullscreen; |
From: <geo...@us...> - 2004-02-24 23:33:14
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23895 Modified Files: scp.cpp Log Message: no message Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** scp.cpp 21 Feb 2004 00:29:18 -0000 1.52 --- scp.cpp 24 Feb 2004 23:26:15 -0000 1.53 *************** *** 886,890 **** if (!strcmp(auto_play, "net1server")) play_net1server(auto_param, auto_port); #ifdef INCLUDE_GAMEX ! if (!strcmp(auto_play, "fg")) play_fg(&scp, SCPGUI_MUSIC); #endif } --- 886,890 ---- if (!strcmp(auto_play, "net1server")) play_net1server(auto_param, auto_port); #ifdef INCLUDE_GAMEX ! if (!strcmp(auto_play, "fg")) play_fg(&scp, SCPGUI_MUSIC, auto_param); #endif } |
From: <geo...@us...> - 2004-02-24 23:32:33
|
Update of /cvsroot/timewarp/source/gamex/edit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23694/gamex/edit Modified Files: edit_dialogue.cpp edit_dialogue.h Log Message: changed gamex autoplay a little, so that you can choose gametypes or "normal" to start, and a few small other updates Index: edit_dialogue.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/edit/edit_dialogue.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** edit_dialogue.cpp 15 Feb 2004 13:08:56 -0000 1.8 --- edit_dialogue.cpp 24 Feb 2004 23:25:07 -0000 1.9 *************** *** 597,598 **** --- 597,663 ---- return 0; } + + + + + + /** \brief recursively finds the node with the specified id; returns 0 on failure. + */ + + Dialo *Dialo::findnode(const char *findid) + { + if (strcmp(id, findid) == 0) + return this; + + int i; + Dialo *d = 0; + for ( i = 0; i < Nbranches; ++i ) + { + d = branch[i]->findnode(findid); + if (d) + break; + } + + return d; + } + + + + + /** \brief recursively saves the dialog states + */ + + void Dialo::save_state(FILE *f) + { + if (!f) + return; + + int i = fwrite(&state, 1, sizeof(int), f); + + if (!i) + return; + + for ( i = 0; i < Nbranches; ++i ) + branch[i]->save_state(f); + } + + + /** \brief recursively reads (and overwrites) the dialog states + */ + + void Dialo::read_state(FILE *f) + { + if (!f) + return; + + int i = fread(&state, 1, sizeof(int), f); + + if (!i) + return; + + for ( i = 0; i < Nbranches; ++i ) + branch[i]->read_state(f); + } + + + Index: edit_dialogue.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/edit/edit_dialogue.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** edit_dialogue.h 22 Feb 2004 10:49:36 -0000 1.9 --- edit_dialogue.h 24 Feb 2004 23:25:07 -0000 1.10 *************** *** 66,69 **** --- 66,73 ---- void discard_branches(); + + Dialo *findnode(const char *id); // finds the node with the specified id; returns 0 on failure. + void save_state(FILE *f); + void read_state(FILE *f); }; |