small updates

This commit is contained in:
Magnus Auvinen 2007-07-22 12:27:49 +00:00
parent a05a7affbe
commit 4a2f1d3beb
5 changed files with 34 additions and 35 deletions

View file

@ -244,7 +244,7 @@ weapons {
nummuzzlesprites 3
muzzleoffsetx 50.0
muzzleoffsety 6.0
maxammo 5
maxammo 10
recoil 10
firedelay 100
muzzleduration 5
@ -253,7 +253,7 @@ weapons {
offsety 4.0
meleedamage 0
meleereach 0
ammoregentime 1000
ammoregentime 500
duration -1
movetime 0
velocity 0
@ -324,7 +324,7 @@ weapons {
muzzleoffsety 0.0
maxammo 10
recoil 10
firedelay 300
firedelay 150
muzzleduration 0
visual_size 96
offsetx 4.0
@ -372,12 +372,12 @@ weapons {
muzzleoffsety 0.0
maxammo 0
recoil 0
firedelay 400
firedelay 800
muzzleduration 0
visual_size 96
offsetx 0.0
offsety 0.0
meleedamage 10
meleedamage 9
meleereach 0
ammoregentime 0
duration 15000

View file

@ -249,7 +249,7 @@ public:
reporttime += time_freq()*reportinterval;
}
totaltime += time_get()-t;
//thread_sleep(1);
thread_sleep(1);
}
mods_shutdown();

View file

@ -1003,21 +1003,22 @@ void ingamemenu_render()
{
if (!local_player)
return;
gfx_mapscreen(0, 0, 800, 600);
gfx_mapscreen(0, 0, 800, 600); // TODO: fix me
// Ingame menu - quit and change team (if tdm)
float mx,my;
int rx, ry;
inp_mouse_relative(&rx, &ry);
mouse_pos.x += rx;
mouse_pos.y += ry;
if(mouse_pos.x < 0) mouse_pos.x = 0;
if(mouse_pos.y < 0) mouse_pos.y = 0;
if(mouse_pos.x > gfx_screenwidth()) mouse_pos.x = gfx_screenwidth();
if(mouse_pos.y > gfx_screenheight()) mouse_pos.y = gfx_screenheight();
static vec2 menu_mouse_pos(0,0);
menu_mouse_pos.x += rx;
menu_mouse_pos.y += ry;
if(menu_mouse_pos.x < 0) mouse_pos.x = 0;
if(menu_mouse_pos.y < 0) mouse_pos.y = 0;
if(menu_mouse_pos.x > gfx_screenwidth()) menu_mouse_pos.x = gfx_screenwidth();
if(menu_mouse_pos.y > gfx_screenheight()) menu_mouse_pos.y = gfx_screenheight();
// update the ui
mx = (mouse_pos.x/(float)gfx_screenwidth())*800.0f;
my = (mouse_pos.y/(float)gfx_screenheight())*600.0f;
mx = (menu_mouse_pos.x/(float)gfx_screenwidth())*800.0f;
my = (menu_mouse_pos.y/(float)gfx_screenheight())*600.0f;
int buttons = 0;
if(inp_key_pressed(input::mouse_1)) buttons |= 1;
@ -1026,12 +1027,6 @@ void ingamemenu_render()
ui_update(mx,my,mx*3.0f,my*3.0f,buttons);
gfx_texture_set(cursor_texture);
gfx_quads_begin();
gfx_quads_setcolor(1,1,1,1);
gfx_quads_drawTL(mx,my,24,24);
gfx_quads_end();
char buf[128];
if (gametype == GAMETYPE_TDM)
{
@ -1047,11 +1042,18 @@ void ingamemenu_render()
}
}
if (ui_do_button(&menu_quit, "Quit", 0, 30, 350, 170, 48, draw_teewars_button))
if (ui_do_button(&menu_quit, "Disconnect", 0, 30, 350, 170, 48, draw_teewars_button))
{
//if (get_state() == STATE_CONNECTING || get_state() == STATE_ONLINE)
main_client.disconnect();
}
gfx_texture_set(cursor_texture);
gfx_quads_begin();
gfx_quads_setcolor(1,1,1,1);
gfx_quads_drawTL(mx,my,24,24);
gfx_quads_end();
}
void modc_render()
@ -1115,6 +1117,7 @@ void modc_render()
input::clear_key(); // TODO: bypasses the engine interface
// fetch new input
if(!menu_active)
{
int x, y;
inp_mouse_relative(&x, &y);
@ -1585,7 +1588,7 @@ void modc_render()
sprintf(buf, "%4d", player->latency);
float tw = gfx_pretty_text_width(48.0f, buf);
gfx_pretty_text(offsetx + x + 220, y, 48, buf);
gfx_pretty_text(offsetx + x + 240, y, 48, buf);
offsets[player->team] += 58.0f;
}

View file

@ -4,5 +4,5 @@ MACRO_CONFIG_INT(key_jump, 32, 32, 512)
MACRO_CONFIG_INT(key_fire, 384, 32, 512)
MACRO_CONFIG_INT(key_hook, 385, 32, 512)
MACRO_CONFIG_INT(scorelimit, 2, 0, 1000)
MACRO_CONFIG_INT(scorelimit, 20, 0, 1000)
MACRO_CONFIG_INT(timelimit, 0, 0, 1000)

View file

@ -343,7 +343,7 @@ game_world world;
gameobject::gameobject()
: entity(OBJTYPE_GAME)
{
gametype = GAMETYPE_DM;
gametype = GAMETYPE_TDM;
game_over_tick = -1;
sudden_death = 0;
round_start_tick = server_tick();
@ -703,10 +703,6 @@ void player::respawn()
weapons[WEAPON_GUN].got = true;
weapons[WEAPON_GUN].ammo = data->weapons[active_weapon].maxammo;
// TEMP DEBUG
weapons[WEAPON_ROCKET_BACKPACK].got = true;
weapons[WEAPON_ROCKET_BACKPACK].ammo = 10;
active_weapon = WEAPON_GUN;
reload_timer = 0;
@ -1006,7 +1002,7 @@ void player::tick()
// TODO: remove this tick count, it feels weird
if(dead)
{
if(server_tick()-die_tick >= server_tickspeed()*3) // auto respawn after 3 sec
if(server_tick()-die_tick >= server_tickspeed()*5) // auto respawn after 3 sec
respawn();
if(input.fire && server_tick()-die_tick >= server_tickspeed()/2) // auto respawn after 0.5 sec
respawn();
@ -1376,14 +1372,14 @@ void powerup::tick()
if(pplayer->health < data->playerinfo[gameobj.gametype].maxhealth)
{
pplayer->health = min((int)data->playerinfo[gameobj.gametype].maxhealth, pplayer->health + 1);
respawntime = 20;
respawntime = 15;
}
break;
case POWERUP_TYPE_ARMOR:
if(pplayer->armor < data->playerinfo[gameobj.gametype].maxarmor)
{
pplayer->armor = min((int)data->playerinfo[gameobj.gametype].maxarmor, pplayer->armor + 1);
respawntime = 20;
respawntime = 15;
}
break;
@ -1393,8 +1389,8 @@ void powerup::tick()
if(pplayer->weapons[subtype].ammo < 10 || !pplayer->weapons[subtype].got)
{
pplayer->weapons[subtype].got = true;
pplayer->weapons[subtype].ammo = min(10, pplayer->weapons[subtype].ammo + 5);
respawntime = 20;
pplayer->weapons[subtype].ammo = min(10, pplayer->weapons[subtype].ammo + 10);
respawntime = 15;
}
}
break;
@ -1404,7 +1400,7 @@ void powerup::tick()
pplayer->ninjaactivationtick = server_tick();
pplayer->weapons[WEAPON_NINJA].got = true;
pplayer->active_weapon = WEAPON_NINJA;
respawntime = 20;
respawntime = 90;
break;
}
default: