Power penalty for dying: lose 1/2, drop 1/3
This commit is contained in:
parent
d524909f3a
commit
6adc079ecd
3 changed files with 10 additions and 3 deletions
|
@ -90,7 +90,7 @@ void process_items(void) {
|
|||
if(v == 1) {
|
||||
switch(item->type) {
|
||||
case Power:
|
||||
player_set_power(&global.plr, global.plr.power + 3);
|
||||
player_set_power(&global.plr, global.plr.power + POWER_VALUE);
|
||||
break;
|
||||
case Point:
|
||||
global.points += 100;
|
||||
|
|
|
@ -46,4 +46,6 @@ void process_items(void);
|
|||
void spawn_item(complex pos, Type type);
|
||||
void spawn_items(complex pos, int point, int power, int bomb, int life);
|
||||
|
||||
#define POWER_VALUE 3
|
||||
|
||||
#endif
|
||||
|
|
|
@ -205,8 +205,13 @@ void player_realdeath(Player *plr) {
|
|||
plr->respawntime = global.frames;
|
||||
plr->moveflags = 0;
|
||||
|
||||
create_item(plr->pos, 6-15*I, Power);
|
||||
create_item(plr->pos, -6-15*I, Power);
|
||||
int drop = (plr->power / 3.0) / POWER_VALUE;
|
||||
|
||||
for(int i = 0; i < drop; ++i) {
|
||||
create_item(plr->pos, (10+7*frand()) * cexp(I*(1.25*M_PI+0.5*i*M_PI/drop)), Power);
|
||||
}
|
||||
|
||||
player_set_power(plr, plr->power / 2.0);
|
||||
|
||||
plr->pos = VIEWPORT_W/2 + VIEWPORT_H*I+30.0I;
|
||||
plr->recovery = -(global.frames + DEATH_DELAY + 150);
|
||||
|
|
Loading…
Reference in a new issue