From 420f8e7442077aab83b92270bef22f123113af73 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Fri, 27 May 2011 22:43:30 +0800 Subject: Make NBHL/NWHL eat things in the same way as BHOL/WHOL Also make ANAR move opposite to Newtonian gravity diff --git a/src/elements/amtr.c b/src/elements/amtr.c index 54d8a85..49a9618 100644 --- a/src/elements/amtr.c +++ b/src/elements/amtr.c @@ -9,7 +9,7 @@ int update_AMTR(UPDATE_FUNC_ARGS) { r = pmap[y+ry][x+rx]; if ((r>>8)>=NPART || !r) continue; - if ((r&0xFF)!=PT_AMTR && (r&0xFF)!=PT_DMND && (r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && (r&0xFF)!=PT_NONE && (r&0xFF)!=PT_PHOT && (r&0xFF)!=PT_VOID && (r&0xFF)!=PT_BHOL && (r&0xFF)!=PT_PRTI && (r&0xFF)!=PT_PRTO) + if ((r&0xFF)!=PT_AMTR && (r&0xFF)!=PT_DMND && (r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && (r&0xFF)!=PT_NONE && (r&0xFF)!=PT_PHOT && (r&0xFF)!=PT_VOID && (r&0xFF)!=PT_BHOL && (r&0xFF)!=PT_NBHL && (r&0xFF)!=PT_PRTI && (r&0xFF)!=PT_PRTO) { parts[i].life++; if (parts[i].life==4) diff --git a/src/elements/nbhl.c b/src/elements/nbhl.c index da0942d..69b6881 100644 --- a/src/elements/nbhl.c +++ b/src/elements/nbhl.c @@ -1,21 +1,6 @@ #include int update_NBHL(UPDATE_FUNC_ARGS) { - int r, rx, ry; gravmap[y/CELL][x/CELL] += 0.1f; - - for (rx=-2; rx<3; rx++) - for (ry=-2; ry<3; ry++) - if (x+rx>=0 && y+ry>0 && x+rx>8)>=NPART || !r) - continue; - if ((r&0xFF)!=PT_NBHL) - { - if((r&0xFF)>8); - } - } return 0; } diff --git a/src/powder.c b/src/powder.c index 1fc094d..544430b 100644 --- a/src/powder.c +++ b/src/powder.c @@ -76,10 +76,10 @@ int eval_move(int pt, int nx, int ny, unsigned *rr) if (rr) *rr = r; - if ((r&0xFF)==PT_VOID || (r&0xFF)==PT_BHOL) + if ((r&0xFF)==PT_VOID || (r&0xFF)==PT_BHOL || (r&0xFF)==PT_NBHL) return 1; - if ((r&0xFF)==PT_WHOL && pt==PT_ANAR) + if (((r&0xFF)==PT_WHOL||(r&0xFF)==PT_NWHL) && pt==PT_ANAR) return 1; if (pt==PT_SPRK)//spark shouldn't move @@ -255,7 +255,7 @@ int try_move(int i, int x, int y, int nx, int ny) parts[i].type=PT_NONE; return 0; } - if ((r&0xFF)==PT_BHOL) //this is where blackhole eats particles + if ((r&0xFF)==PT_BHOL || (r&0xFF)==PT_NBHL) //this is where blackhole eats particles { if (parts[i].type == PT_STKM) { @@ -275,7 +275,7 @@ int try_move(int i, int x, int y, int nx, int ny) return 0; } - if ((r&0xFF)==PT_WHOL && parts[i].type==PT_ANAR) //whitehole eats anar + if (((r&0xFF)==PT_WHOL||(r&0xFF)==PT_NWHL) && parts[i].type==PT_ANAR) //whitehole eats anar { parts[i].type=PT_NONE; if (!legacy_enable) @@ -1525,7 +1525,13 @@ void update_particles_i(pixel *vid, int start, int inc) pGravY = ptypes[t].gravity * ((float)(y - YCNTR) / pGravD); } //Get some gravity from the gravity map - if(!(ptypes[t].properties & TYPE_SOLID)) + if (t==PT_ANAR) + { + // perhaps we should have a ptypes variable for this + pGravX -= gravx[y/CELL][x/CELL]; + pGravY -= gravy[y/CELL][x/CELL]; + } + else if(!(ptypes[t].properties & TYPE_SOLID)) { pGravX += gravx[y/CELL][x/CELL]; pGravY += gravy[y/CELL][x/CELL]; -- cgit v0.9.2-21-gd62e