Skip to content

Commit

Permalink
scent bionic
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel authored and Daniel committed Oct 19, 2011
1 parent ac9fcd7 commit 88f6724
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
8 changes: 6 additions & 2 deletions bionics.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ bio_carbon, bio_armor_head, bio_armor_torso, bio_armor_arms, bio_armor_legs,
// Player Activated
bio_flashlight, bio_night_vision, bio_infrared,
bio_face_mask, // TODO
bio_ads, bio_ods, bio_scent_mask, bio_cloak, bio_painkiller, bio_nanobots,
bio_ads, bio_ods, bio_scent_mask,bio_scent_vision, bio_cloak, bio_painkiller, bio_nanobots,
bio_heatsink, bio_resonator, bio_time_freeze, bio_teleport, bio_blood_anal,
bio_blood_filter, bio_alarm,
bio_evap, bio_lighter, bio_claws, bio_blaster, bio_laser, bio_emp,
Expand Down Expand Up @@ -71,7 +71,7 @@ struct bionic {
const bionic_data bionics[] = {
{"NULL bionics", false, false, 0, 0, "\
If you're seeing this, it's a bug."},

// NAME ,PW_SRC, ACT ,COST, TIME,
{"Battery System", true, false, 0, 0, "\
You have a battery draining attachment, and thus can make use of the energy\n\
contained in normal, everyday batteries. Use 'E' to consume batteries."},
Expand Down Expand Up @@ -179,6 +179,10 @@ damaging unarmed attackers and those with a conductive weapon."},
{"Olfactory Mask", false, true, 1, 8, "\
While this system is powered, your body will produce very little odor, making\n\
it nearly impossible for creatures to track you by scent."},
{"Scent Vision", false, true, 1, 10, "\
While this system is powered, you're able to visually sense your own scent,\n\
making it possible for you to recognize your surroundings even if you can't\n\
see it."},
{"Cloaking System", false, true, 2, 1, "\
This high-power system uses a set of cameras and LEDs to make you blend into\n\
your background, rendering you fully invisible to normal vision. However,\n\
Expand Down
31 changes: 27 additions & 4 deletions game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ game::game()
in_tutorial = false; // We're not in a tutorial game
weather = WEATHER_CLEAR; // Start with some nice weather...
turnssincelastmon = 0; //Auto run mode init
autorunmode = false;
autorunmode = true;

turn.season = SPRING; // ... with winter conveniently a long ways off

Expand Down Expand Up @@ -1754,10 +1754,33 @@ void game::draw()
write_msg();
}

bool game::isBetween(int test, int down, int up)
{
if(test>down && test<up) return true;
else return false;
}

void game::draw_ter()
{
int t = 0;
m.draw(this, w_terrain);
m.draw(this, w_terrain);
//TODO Draw scent when bionic is installed
//if (!u.has_active_bionic(bio_scent_mask))
for (int realx = u.posx - SEEX; realx <= u.posx + SEEX; realx++) {
for (int realy = u.posy - SEEY; realy <= u.posy + SEEY; realy++) {
if (scent(realx, realy) != 0) {
int tempx = u.posx - realx, tempy = u.posy - realy;
if (!(isBetween(tempx, -2, 2) && isBetween(tempy, -2, 2))) {
mvwputch(w_terrain, realy + SEEY - u.posy,
realx + SEEX - u.posx, c_magenta, '#');
if(mon_at(realx,realy)!= -1)
mvwputch(w_terrain, realy + SEEY - u.posy,
realx + SEEX - u.posx, c_white, '?');

}
}
}
}

// Draw monsters
int distx, disty;
Expand Down Expand Up @@ -4977,7 +5000,7 @@ void game::spawn_mon(int shiftx, int shifty)
int iter;
int t;
// Create a new NPC?

/*
if (one_in(50 + 5 * cur_om.npcs.size())) {
npc temp;
temp.randomize(this);
Expand All @@ -4988,7 +5011,7 @@ void game::spawn_mon(int shiftx, int shifty)
temp.attitude = NPCATT_TALK;
active_npc.push_back(temp);
}

*/

// Now, spawn monsters (perhaps)
monster zom;
Expand Down
2 changes: 2 additions & 0 deletions game.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class game
int npc_at(int x, int y); // Index of the npc at (x, y); -1 for none
int mon_at(int x, int y); // Index of the monster at (x, y); -1 for none
bool is_empty(int x, int y); // True if no PC, no monster, move cost > 0
bool isBetween(int test, int down, int up);
bool is_in_sunlight(int x, int y); // Checks outdoors + sunny
void kill_mon(int index); // Kill that monster; fixes any pointers etc
void explode_mon(int index); // Explode a monster; like kill_mon but messier
Expand Down Expand Up @@ -259,6 +260,7 @@ class game
void groupdebug(); // Get into on monster groups



// ########################## DATA ################################

signed char last_target;// The last monster targeted
Expand Down

0 comments on commit 88f6724

Please sign in to comment.