Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutated flowers concept #2

Merged
merged 1 commit into from
Oct 5, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 36 additions & 21 deletions game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ void game::start_game()
u.per_cur = u.per_max;
u.int_cur = u.int_max;
u.dex_cur = u.dex_max;
nextspawn = int(turn);
nextspawn = int(turn);
temperature = 65; // Springtime-appropriate?

// Put some NPCs in there!
Expand Down Expand Up @@ -513,12 +513,12 @@ void game::create_starting_npcs()
tmp.attitude = NPCATT_NULL;
tmp.mission = NPC_MISSION_SHELTER;
tmp.chatbin.first_topic = TALK_SHELTER;
tmp.chatbin.missions.push_back(
tmp.chatbin.missions.push_back(
reserve_random_mission(ORIGIN_OPENER_NPC, om_location(), tmp.id) );

active_npc.push_back(tmp);
}


// MAIN GAME LOOP
// Returns true if game is over (death, saved, quit, etc)
Expand Down Expand Up @@ -812,7 +812,7 @@ void game::process_activity()
skill_name(u.activity.index).c_str(), u.sklevel[u.activity.index]);
}
break;

case ACT_VEHICLE:
complete_vehicle (this);
break;
Expand Down Expand Up @@ -975,7 +975,7 @@ void game::assign_mission(int id)
mission *miss = find_mission(id);
(m_s.*miss->type->start)(this, miss);
}

int game::reserve_mission(mission_id type, int npc_id)
{
mission tmp = mission_types[type].create(this, npc_id);
Expand Down Expand Up @@ -1677,7 +1677,7 @@ bool game::load_master()
if (fin.peek() == '\n')
fin.get(junk); // Chomp that pesky endline
}

fin.close();
return true;
}
Expand Down Expand Up @@ -2322,7 +2322,7 @@ void game::list_missions()
for (int i = 0; i < umissions.size(); i++) {
mission *miss = find_mission(umissions[i]);
nc_color col = c_white;
if (i == u.active_mission && tab == 0)
if (i == u.active_mission && tab == 0)
col = c_ltred;
if (selection == i)
mvwprintz(w_missions, 3 + i, 0, hilite(col), miss->name().c_str());
Expand Down Expand Up @@ -2706,7 +2706,7 @@ unsigned char game::light_level()
int flashlight = u.active_item_charges(itm_flashlight_on);
//int light = u.light_items();
if (ret < 10 && flashlight > 0) {
/* additive so that low battery flashlights still increase the light level
/* additive so that low battery flashlights still increase the light level
rather than decrease it */
ret += flashlight;
if (ret > 10)
Expand Down Expand Up @@ -2793,7 +2793,7 @@ faction* game::random_evil_faction()
bool game::sees_u(int x, int y, int &t)
{
return (!u.has_active_bionic(bio_cloak) &&
!u.has_artifact_with(AEP_INVISIBLE) &&
!u.has_artifact_with(AEP_INVISIBLE) &&
m.sees(x, y, u.posx, u.posy, light_level(), t));
}

Expand Down Expand Up @@ -2974,9 +2974,9 @@ void game::mon_info()
// 5 4 3 8 is used for local monsters (for when we explain them below)
mvwprintz(w_moninfo, 0, 0, (unique_types[7].empty() ?
c_dkgray : (dangerous[7] ? c_ltred : c_ltgray)), "NW:");
mvwprintz(w_moninfo, 0, 15, (unique_types[0].empty() ?
mvwprintz(w_moninfo, 0, 15, (unique_types[0].empty() ?
c_dkgray : (dangerous[0] ? c_ltred : c_ltgray)), "North:");
mvwprintz(w_moninfo, 0, 33, (unique_types[1].empty() ?
mvwprintz(w_moninfo, 0, 33, (unique_types[1].empty() ?
c_dkgray : (dangerous[1] ? c_ltred : c_ltgray)), "NE:");
mvwprintz(w_moninfo, 1, 0, (unique_types[6].empty() ?
c_dkgray : (dangerous[6] ? c_ltred : c_ltgray)), "West:");
Expand Down Expand Up @@ -3286,7 +3286,7 @@ void game::check_warmth()
add_msg("Your body is cold.");
u.add_disease(DI_COLD, abs(warmth), this);
} else if (warmth >= 12) {
add_msg("Your body is too hot.");
add_msg("Your body is too hot.");
u.add_disease(DI_HOT, warmth * 2, this);
}
// HANDS
Expand Down Expand Up @@ -3433,7 +3433,7 @@ void game::add_footstep(int x, int y, int volume, int distance)
void game::draw_footsteps()
{
for (int i = 0; i < footsteps.size(); i++) {
mvwputch(w_terrain, SEEY + footsteps[i].y - u.posy,
mvwputch(w_terrain, SEEY + footsteps[i].y - u.posy,
SEEX + footsteps[i].x - u.posx, c_yellow, '?');
}
footsteps.clear();
Expand Down Expand Up @@ -3615,7 +3615,7 @@ void game::use_computer(int x, int y)
debugmsg("Tried to use computer at (%d, %d) - none there", x, y);
return;
}

used->use(this);

refresh_all();
Expand Down Expand Up @@ -3864,7 +3864,7 @@ void game::explode_mon(int index)
for (int i = 0; i < num_chunks; i++) {
int tarx = posx + rng(-3, 3), tary = posy + rng(-3, 3);
std::vector<point> traj = line_to(posx, posy, tarx, tary, 0);

bool done = false;
for (int j = 0; j < traj.size() && !done; j++) {
tarx = traj[j].x;
Expand Down Expand Up @@ -4527,7 +4527,22 @@ shape, but with long, twisted, distended limbs.");
add_msg("You hear the rumble of rock shifting.");
add_event(EVENT_TEMPLE_SPAWN, turn + 3);
}

//-----Jovan's-----
//flowers
else if ((m.ter(examx, examy)==t_mutpoppy)&&(query_yn("Really explore this flower?"))) {
add_msg("This flower has a heady aroma");
if (!(u.is_wearing(itm_mask_filter)||u.is_wearing(itm_mask_gas))) {
add_msg("You fall asleep...");
u.add_disease(DI_SLEEP, 1200, this);
add_msg("Your legs are covered by flower's roots!");
u.hurt(this,bp_legs, 0, 10);
u.moves-=50;
}
m.ter(examx, examy) = t_grass;
m.add_item(examx, examy, this->itypes[itm_poppy_harmless],0);
m.add_item(examx, examy, this->itypes[itm_poppy_feromone],0);
}
//-----------------
if (m.tr_at(examx, examy) != tr_null &&
traps[m.tr_at(examx, examy)]->difficulty < 99 &&
u.per_cur-u.encumb(bp_eyes) >= traps[m.tr_at(examx, examy)]->visibility &&
Expand Down Expand Up @@ -6403,13 +6418,13 @@ void game::vertical_move(int movez, bool force)
stairy = u.posy;
}
}

bool replace_monsters = false;
// Replace the stair monsters if we just came back
if (abs(monstairx - levx) <= 1 && abs(monstairy - levy) <= 1 &&
monstairz == levz + movez)
replace_monsters = true;

if (!force) {
monstairx = levx;
monstairy = levy;
Expand Down Expand Up @@ -6608,7 +6623,7 @@ void game::update_map(int &x, int &y)
npc temp;
for (int i = 0; i < cur_om.npcs.size(); i++) {
if (rl_dist(levx + int(MAPSIZE / 2), levy + int(MAPSIZE / 2),
cur_om.npcs[i].mapx, cur_om.npcs[i].mapy) <=
cur_om.npcs[i].mapx, cur_om.npcs[i].mapy) <=
int(MAPSIZE / 2) + 1) {
int dx = cur_om.npcs[i].mapx - levx, dy = cur_om.npcs[i].mapy - levy;
if (debugmon)
Expand Down Expand Up @@ -7074,7 +7089,7 @@ void game::msg_buffer()
for (i = 1; i <= 20 && line <= 23 && offset + i <= messages.size(); i++) {
game_message *mtmp = &(messages[ messages.size() - (offset + i) ]);
calendar timepassed = turn - mtmp->turn;

int tp = int(timepassed);
nc_color col = (tp <= 2 ? c_ltred : (tp <= 7 ? c_white :
(tp <= 12 ? c_ltgray : c_dkgray)));
Expand Down Expand Up @@ -7117,7 +7132,7 @@ void game::msg_buffer()

ch = input();
int dirx = 0, diry = 0;

get_direction(this, dirx, diry, ch);
if (diry == -1 && offset > 0)
offset--;
Expand Down
34 changes: 19 additions & 15 deletions itype.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ itm_frame, itm_wheel, itm_big_wheel, itm_seat, itm_vehicle_controls,
itm_steel_plate, itm_alloy_plate, itm_spiked_plate, itm_hard_plate,
// Footwear
itm_sneakers, itm_boots, itm_boots_steel, itm_boots_winter, itm_mocassins,
itm_flip_flops, itm_dress_shoes, itm_heels,
itm_flip_flops, itm_dress_shoes, itm_heels,
// Legwear
itm_jeans, itm_pants, itm_pants_leather, itm_pants_cargo, itm_pants_army,
itm_skirt,
Expand Down Expand Up @@ -174,6 +174,10 @@ itm_software_useless, itm_software_hacking, itm_software_medical,
itm_software_math, itm_software_blood_data,
// MacGuffins!
itm_note,
//-----Jovan's. Flowers!-----
itm_poppy_harmless, itm_poppy_feromone,
//---------------------------

// Static (non-random) artifacts should go here.
num_items,
// These shouldn't be counted among "normal" items; thus, they are outside the
Expand Down Expand Up @@ -308,27 +312,27 @@ struct itype
// Used for save files; aligns to itype_id above.
unsigned char rarity; // How often it's found
unsigned int price; // Its value

std::string name; // Proper name
std::string description;// Flavor text

char sym; // Symbol on the map
nc_color color; // Color on the map (color.h)

material m1; // Main material
material m2; // Secondary material -- MNULL if made of just 1 thing

unsigned int volume; // Space taken up by this item
unsigned int weight; // Weight in quarter-pounds; is 64 lbs max ok?
// Also assumes positive weight. No helium, guys!

signed char melee_dam; // Bonus for melee damage; may be a penalty
signed char melee_cut; // Cutting damage in melee
signed char m_to_hit; // To-hit bonus for melee combat; -5 to 5 is reasonable

unsigned item_flags : NUM_ITEM_FLAGS;
unsigned techniques : NUM_TECHNIQUES;

virtual bool is_food() { return false; }
virtual bool is_ammo() { return false; }
virtual bool is_gun() { return false; }
Expand Down Expand Up @@ -360,7 +364,7 @@ struct itype
item_flags = 0;
techniques = 0;
}

itype(int pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, material pm2,
Expand Down Expand Up @@ -413,13 +417,13 @@ struct it_comest : public itype
char psym, nc_color pcolor, material pm1,
unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut,
signed char pm_to_hit, unsigned pitem_flags,
signed char pm_to_hit, unsigned pitem_flags,

signed char pquench, unsigned char pnutr, signed char pspoils,
signed char pstim, signed char phealthy, unsigned char paddict,
unsigned char pcharges, signed char pfun, itype_id pcontainer,
itype_id ptool, void (iuse::*puse)(game *, player *, item *, bool),
add_type padd)
add_type padd)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, MNULL,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
quench = pquench;
Expand Down Expand Up @@ -628,8 +632,8 @@ struct it_book : public itype
intel = pintel;
time = ptime;
}
};
};

enum container_flags {
con_rigid,
con_wtight,
Expand Down Expand Up @@ -704,7 +708,7 @@ struct it_tool : public itype
use = puse;
}
};

struct it_bionic : public itype
{
std::vector<bionic_id> options;
Expand Down Expand Up @@ -736,7 +740,7 @@ struct it_macguffin : public itype
{
bool readable; // If true, activated with 'R'
void (iuse::*use)(game *, player *, item *, bool);

virtual bool is_macguffin() { return true; }

it_macguffin(int pid, unsigned char prarity, unsigned int pprice,
Expand Down Expand Up @@ -782,7 +786,7 @@ struct it_style : public itype
virtual bool is_style() { return true; }

std::vector<style_move> moves;

it_style(int pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, material pm2,
Expand Down
18 changes: 13 additions & 5 deletions itypedef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void game::init_itypes ()
"A fake item. If you are reading this it's a bug!",
'$', c_red, MNULL, MNULL, 0, 0, 0, 0, 0, 0));
int index = 3;

// Drinks
// Stim should be -8 to 8.
// quench MAY be less than zero--salt water and liquor make you thirstier.
Expand Down Expand Up @@ -1588,7 +1588,7 @@ A sharpened arrow carved from wood. It's light-weight, does little damage,\n\
and is so-so on accuracy. Stands a good chance of remaining intact once\n\
fired.",
0);

AMMO("carbon fiber arrow",5,300,AT_ARROW, c_green, PLASTIC,
2, 30, 12, 2, 15, 14, 0, 8, "\
High-tech carbon fiber shafts and 100 grain broadheads. Very light weight,\n\
Expand Down Expand Up @@ -1960,7 +1960,7 @@ A bow with wheels that fires high velocity arrows. Weaker people can use\n\
compound bows more easily. Arrows fired from this weapon have a good chance\n\
of remaining intact for re-use.",
mfb(IF_STR8_DRAW)|mfb(IF_RELOAD_AND_SHOOT));

GUN("longbow", 5, 800,c_yellow, WOOD, MNULL,
sk_archery, AT_ARROW,8, 4, 10, 0, 0, 12, 0, 6, 0, 1, 80, "\
A six-foot wooden bow that fires feathered arrows. This takes a fair amount\n\
Expand Down Expand Up @@ -3388,6 +3388,14 @@ MACGUFFIN("paper note", 0, '?', c_white, PAPER, MNULL, 1, 0, 0, 0, 0,
true, &iuse::mcg_note, "\
A hand-written paper note.");

MELEE("poppy flower", 1, 400,',', c_magenta, VEGGY, MNULL,
1, 0, -8, 0, -3, 0, "\
A poppy stalk with some petals.");

MELEE("a poppy bud", 1, 400,',', c_magenta, VEGGY, MNULL,
1, 0, -8, 0, -3, 0, "\
Contains some substances commonly produced by mutated poppy flower");

if (itypes.size() > num_items)
debugmsg("%d items, %d itypes", itypes.size(), num_all_items);

Expand Down Expand Up @@ -3512,7 +3520,7 @@ against large or strong opponents.",

"slap", TEC_RAPID, 2,
"block", TEC_BLOCK, 3,
"block", TEC_BLOCK_LEGS, 4,
"block", TEC_BLOCK_LEGS, 4,
"power-kick", TEC_BRUTAL, 4,
"counter-attack", TEC_COUNTER, 5
);
Expand Down Expand Up @@ -3714,7 +3722,7 @@ attacks with no penalty.",
} while (namepart.find("-") == std::string::npos);
art->name = namedata.str();
start = true;

std::stringstream descdata;
do {
fin >> namepart;
Expand Down
Loading