diff --git a/dat/outfit.xml b/dat/outfit.xml index 8b07342..b20d996 100644 --- a/dat/outfit.xml +++ b/dat/outfit.xml @@ -211,6 +211,7 @@ ExpM 7 0.5 +5 1300 90 550 diff --git a/src/outfit.c b/src/outfit.c index e10c46e..c516536 100644 --- a/src/outfit.c +++ b/src/outfit.c @@ -429,18 +429,20 @@ static void outfit_parseSAmmo(Outfit* tmp, const xmlNodePtr parent) { char str[PATH_MAX] = "\0"; do { - xmlr_float(node, "thrust", tmp->u.amm.thrust); - xmlr_float(node, "turn", tmp->u.amm.turn); - xmlr_float(node, "speed", tmp->u.amm.speed); - xmlr_float(node, "energy", tmp->u.amm.energy); - if(xml_isNode(node, "duration")) - tmp->u.amm.duration = xml_getFloat(node); - else if(xml_isNode(node, "lockon")) - tmp->u.amm.lockon = xml_getFloat(node); - else if(xml_isNode(node, "gfx")) { + /* Basic. */ + xmlr_float(node, "duration", tmp->u.amm.duration); + xmlr_float(node, "lockon", tmp->u.amm.lockon); + xmlr_float(node, "resist", tmp->u.amm.resist); + /* Movement. */ + xmlr_float(node, "thrust", tmp->u.amm.thrust); + xmlr_float(node, "turn", tmp->u.amm.turn); + xmlr_float(node, "speed", tmp->u.amm.speed); + xmlr_float(node, "energy", tmp->u.amm.energy); + if(xml_isNode(node, "gfx")) { snprintf(str, strlen(xml_get(node))+sizeof(OUTFIT_GFX)+10, OUTFIT_GFX"space/%s.png", xml_get(node)); tmp->u.amm.gfx_space = gl_newSprite(str, 6, 6); + continue; } else if(xml_isNode(node, "spfx")) tmp->u.amm.spfx = spfx_get(xml_get(node)); diff --git a/src/outfit.h b/src/outfit.h index afce9ce..c972158 100644 --- a/src/outfit.h +++ b/src/outfit.h @@ -84,6 +84,8 @@ typedef struct Outfit_ { struct { /* Ammo. */ double duration; /* Duration. */ double lockon; /* Time it takes to lock on the target. */ + double resist; /* Lowers chance of jamming by this ammount. */ + double speed; /* Max speed. */ double turn; /* Turn vel. */ double thrust; /* Acceleration. */ diff --git a/src/weapon.c b/src/weapon.c index ca08a0f..19c5c8a 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -131,7 +131,8 @@ static void think_seeker(Weapon* w, const double dt) { if((p->jam_range != 0.) && /* Target has jammer and weapon is in range. */ (vect_dist(&w->solid->pos, &p->solid->pos) < p->jam_range)) { - if(RNGF() < p->jam_chance) { /* Is jammed? */ + /* Check to see if the weapon is gets jammed. */ + if(RNGF() < p->jam_chance - w->outfit->u.amm.resist) { w->status = WEAPON_STATUS_JAMMED; /* Give it a nice random effect. */ effect = RNG(0, 4);