diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-11-05 16:39:54 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-11-05 16:39:54 +0000 |
commit | bcf77b60c7738ac242310fac7f7dc0ba6f523142 (patch) | |
tree | 2b468300fbeffa6c96c5222ea391f206db9d5780 | |
parent | 77bcb697eda706b161cd3b3493774a71da63d58a (diff) | |
download | crawl-ref-bcf77b60c7738ac242310fac7f7dc0ba6f523142.tar.gz crawl-ref-bcf77b60c7738ac242310fac7f7dc0ba6f523142.zip |
Implemented 1589868: lightning grounds on metal, fire/cold (including
fireball!) reflect off green crystal.
Also put in a boatload of spacing fixes, sorry, they were driving me mad.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup@335 c06c8d41-db1a-0410-9941-cceddc491573
26 files changed, 164 insertions, 184 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index b878e11402..2404c82016 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -67,11 +67,11 @@ static int spready[] = { -1, 1, 0, 0 }; static int opdir[] = { 2, 1, 4, 3 }; static FixedArray < bool, 19, 19 > explode_map; -// helper functions (some of these, esp. affect(), should probably +// helper functions (some of these, esp. affect(), should probably // be public): static void sticky_flame_monster( int mn, bool source, int hurt_final ); static bool affectsWalls(struct bolt &beam); -static bool isBouncy(struct bolt &beam); +static bool isBouncy(struct bolt &beam, unsigned char gridtype); static void beam_drop_object( struct bolt &beam, item_def *item, int x, int y ); static bool beam_term_on_target(struct bolt &beam, int x, int y); static void beam_explodes(struct bolt &beam, int x, int y); @@ -161,7 +161,7 @@ void zapping(char ztype, int power, struct bolt &pbolt) #endif // GDL: note that rangeMax is set to 0, which means that max range is - // equal to range. This is OK, since rangeMax really only matters for + // equal to range. This is OK, since rangeMax really only matters for // stuff monsters throw/zap. // all of the following might be changed by zappy(): @@ -1179,10 +1179,10 @@ static void zappy( char z_type, int power, struct bolt &pbolt ) } // end zappy() /* NEW (GDL): - * Now handles all beamed/thrown items and spells, tracers, and their effects. + * Now handles all beamed/thrown items and spells, tracers, and their effects. * item is used for items actually thrown/launched * - * if item is NULL, there is no physical object being thrown that could + * if item is NULL, there is no physical object being thrown that could * land on the ground. */ @@ -1279,7 +1279,7 @@ void fire_beam( struct bolt &pbolt, item_def *item ) if (affectsWalls(pbolt)) { // should we ever get a tracer with a wall-affecting - // beam (possible I suppose), we'll quit tracing now. + // beam (possible I suppose), we'll quit tracing now. if (!pbolt.is_tracer) rangeRemaining -= affect(pbolt, tx, ty); @@ -1290,7 +1290,7 @@ void fire_beam( struct bolt &pbolt, item_def *item ) else { // BEGIN bounce case - if (!isBouncy(pbolt)) { + if (!isBouncy(pbolt, grd[tx][ty])) { ray.regress(); tx = ray.x(); ty = ray.y(); @@ -1323,13 +1323,13 @@ void fire_beam( struct bolt &pbolt, item_def *item ) // cell (e.g. a mage wants an explosion to happen // between two monsters) - // in this case, don't affect the cell - players and + // in this case, don't affect the cell - players and // monsters have no chance to dodge or block such // a beam, and we want to avoid silly messages. if (tx == pbolt.target_x && ty == pbolt.target_y) beamTerminate = beam_term_on_target(pbolt, tx, ty); - // affect the cell, except in the special case noted + // affect the cell, except in the special case noted // above -- affect() will early out if something gets // hit and the beam is type 'term on target'. if (!beamTerminate || !pbolt.is_explosion) @@ -1400,7 +1400,7 @@ void fire_beam( struct bolt &pbolt, item_def *item ) ray.advance(); } // end- while !beamTerminate - // the beam has finished, and terminated at tx, ty + // the beam has finished, and terminated at tx, ty // leave an object, if applicable if (item) @@ -1440,7 +1440,7 @@ void fire_beam( struct bolt &pbolt, item_def *item ) int mons_adjust_flavoured( struct monsters *monster, struct bolt &pbolt, int hurted, bool doFlavouredEffects ) { - // if we're not doing flavored effects, must be preliminary + // if we're not doing flavored effects, must be preliminary // damage check only; do not print messages or apply any side // effects! int resist; @@ -1826,7 +1826,7 @@ int mons_ench_f2(struct monsters *monster, struct bolt &pbolt) switch (pbolt.flavour) /* put in magic resistance */ { case BEAM_SLOW: /* 0 = slow monster */ - // try to remove haste, if monster is hasted + // try to remove haste, if monster is hasted if (mons_del_ench(monster, ENCH_HASTE)) { if (simple_monster_message(monster, " is no longer moving quickly.")) @@ -1835,7 +1835,7 @@ int mons_ench_f2(struct monsters *monster, struct bolt &pbolt) return (MON_AFFECTED); } - // not hasted, slow it + // not hasted, slow it if (mons_add_ench(monster, ENCH_SLOW)) { // put in an exception for fungi, plants and other things you won't @@ -2121,7 +2121,7 @@ void sticky_flame_monster( int mn, bool fromPlayer, int levels ) mons_del_ench( monster, ENCH_YOUR_STICKY_FLAME_I, ENCH_YOUR_STICKY_FLAME_IV, true ); - // increase sticky flame strength, cap at 3 (level is 0..3) + // increase sticky flame strength, cap at 3 (level is 0..3) currentStrength += levels; if (currentStrength > 3) @@ -2149,10 +2149,10 @@ void sticky_flame_monster( int mn, bool fromPlayer, int levels ) * fr_count, foe_count: a count of how many friends and foes will (probably) * be hit by this beam * fr_power, foe_power: a measure of how many 'friendly' hit dice it will - * affect, and how many 'unfriendly' hit dice. + * affect, and how many 'unfriendly' hit dice. * - * note that beam properties must be set, as the tracer will take them - * into account, as well as the monster's intelligence. + * note that beam properties must be set, as the tracer will take them + * into account, as well as the monster's intelligence. * */ void fire_tracer(struct monsters *monster, struct bolt &pbolt) @@ -2216,12 +2216,15 @@ void mimic_alert(struct monsters *mimic) monster_teleport( mimic, !one_chance_in(3) ); } // end mimic_alert() -static bool isBouncy(struct bolt &beam) +static bool isBouncy(struct bolt &beam, unsigned char gridtype) { - // at present, only non-enchantment electrical beams bounce. - if (beam.name[0] != '0' && beam.flavour == BEAM_ELECTRICITY) - return (true); - + if (beam.name[0] == '0') + return false; + if (beam.flavour == BEAM_ELECTRICITY && gridtype != DNGN_METAL_WALL) + return true; + if ( (beam.flavour == BEAM_FIRE || beam.flavour == BEAM_COLD) && + (gridtype == DNGN_GREEN_CRYSTAL_WALL) ) + return true; return (false); } @@ -2338,7 +2341,7 @@ static bool beam_term_on_target(struct bolt &beam, int x, int y) // generic - all explosion-type beams can be targetted at empty space, // and will explode there. This semantic also means that a creature - // in the target cell will have no chance to dodge or block, so we + // in the target cell will have no chance to dodge or block, so we // DON'T affect() the cell if this function returns true! if (beam.is_explosion || beam.is_big_cloud) @@ -2405,29 +2408,6 @@ static void beam_drop_object( struct bolt &beam, item_def *item, int x, int y ) } // if (thing_throw == 2) ... } -// somewhat complicated BOUNCE function -// returns # of times beam bounces during routine (usually 1) -// -// step 1 is always the step value from the stepping direction. -#define B_HORZ 1 -#define B_VERT 2 -#define B_BOTH 3 - - -// affects a single cell. -// returns the amount of extra range 'used up' by this beam -// during the affectation. -// -// pseudo-code: -// -// 1. If wall, and wall affecting non-tracer, affect the wall. -// 1b. If for some reason the wall-affect didn't make it into -// a non-wall, return affect_wall() -// 2. for non-tracers, produce cloud effects affect_place_clouds() -// 3. if cell holds player, affect player affect_player() -// 4. if cell holds monster, affect monster affect_monster() -// 5. return range used affectation. - int affect(struct bolt &beam, int x, int y) { // extra range used by hitting something @@ -2446,7 +2426,7 @@ int affect(struct bolt &beam, int x, int y) { rangeUsed += affect_wall(beam, x, y); } - // if it's still a wall, quit - we can't do anything else to + // if it's still a wall, quit - we can't do anything else to // a wall. Otherwise effects (like clouds, etc) are still possible. if (grid_is_solid(grd[x][y])) return (rangeUsed); @@ -2458,7 +2438,7 @@ int affect(struct bolt &beam, int x, int y) if (!beam.is_tracer) rangeUsed += affect_place_clouds(beam, x, y); - // if player is at this location, try to affect unless term_on_target + // if player is at this location, try to affect unless term_on_target if (x == you.x_pos && y == you.y_pos) { // Done this way so that poison blasts affect the target once (via @@ -2475,7 +2455,7 @@ int affect(struct bolt &beam, int x, int y) return (BEAM_STOP); } - // if there is a monster at this location, affect it + // if there is a monster at this location, affect it // submerged monsters aren't really there -- bwr int mid = mgrd[x][y]; if (mid != NON_MONSTER && !mons_has_ench( &menv[mid], ENCH_SUBMERGED )) @@ -2509,7 +2489,7 @@ static bool affectsWalls(struct bolt &beam) if (beam.flavour == BEAM_DISINTEGRATION && beam.damage.num >= 3) return (true); - // eye of devestation? + // eye of devastation? if (beam.flavour == BEAM_NUKE) return (true); @@ -2915,7 +2895,7 @@ static int affect_player( struct bolt &beam ) // BEGIN real beam code beam.msg_generated = true; - // use beamHit, NOT beam.hit, for modification of tohit.. geez! + // use beamHit, NOT beam.hit, for modification of tohit.. geez! beamHit = beam.hit; if (beam.name[0] != '0') @@ -3267,7 +3247,7 @@ static int beam_source(const bolt &beam) } // return amount of range used up by affectation of this monster -static int affect_monster(struct bolt &beam, struct monsters *mon) +static int affect_monster(struct bolt &beam, struct monsters *mon) { int tid = mgrd[mon->x][mon->y]; int hurt; @@ -3370,7 +3350,7 @@ static int affect_monster(struct bolt &beam, struct monsters *mon) if (mons_has_ench( mon, ENCH_SUBMERGED ) && !beam.aimed_at_feet) return (0); // missed me! - // we need to know how much the monster _would_ be hurt by this, before + // we need to know how much the monster _would_ be hurt by this, before // we decide if it actually hits. // Roll the damage: @@ -3398,7 +3378,7 @@ static int affect_monster(struct bolt &beam, struct monsters *mon) const int old_hurt = hurt_final; #endif - // check monster resists, _without_ side effects (since the + // check monster resists, _without_ side effects (since the // beam/missile might yet miss!) hurt_final = mons_adjust_flavoured( mon, beam, hurt_final, false ); @@ -3413,17 +3393,17 @@ static int affect_monster(struct bolt &beam, struct monsters *mon) } #endif - // now, we know how much this monster would (probably) be + // now, we know how much this monster would (probably) be // hurt by this beam. if (beam.is_tracer) { if (hurt_final != 0) { - // monster could be hurt somewhat, but only apply the + // monster could be hurt somewhat, but only apply the // monster's power based on how badly it is affected. - // For example, if a fire giant (power 16) threw a - // fireball at another fire giant, and it only took - // 1/3 damage, then power of 5 would be applied to + // For example, if a fire giant (power 16) threw a + // fireball at another fire giant, and it only took + // 1/3 damage, then power of 5 would be applied to // foe_power or fr_power. if (beam.is_friendly ^ mons_friendly(mon)) { @@ -3446,7 +3426,7 @@ static int affect_monster(struct bolt &beam, struct monsters *mon) // player beams which hit friendly MIGHT annoy them and be considered // naughty if they do much damage (this is so as not to penalize // players that fling fireballs into a melee with fire elementals - // on their side - the elementals won't give a sh*t, after all) + // on their side - the elementals won't give a sh*t, after all) if (nasty_beam(mon, beam)) { @@ -3994,7 +3974,7 @@ static void explosion1(struct bolt &pbolt) // explosion is considered to emanate from beam->target_x, target_y // and has a radius equal to ex_size. The explosion will respect -// boundaries like walls, but go through/around statues/idols/etc. +// boundaries like walls, but go through/around statues/idols/etc. // for each cell affected by the explosion, affect() is called. @@ -4036,9 +4016,9 @@ void explosion( struct bolt &beam, bool hole_in_the_middle ) // as the recursion runs approximately as R^2 explosion_map(beam, 0, 0, 0, 0, r); - // go through affected cells, drawing effect and + // go through affected cells, drawing effect and // calling affect() and affect_items() for each. - // now, we get a bit fancy, drawing all radius 0 + // now, we get a bit fancy, drawing all radius 0 // effects, then radius 1, radius 2, etc. It looks // a bit better that way. @@ -4172,7 +4152,7 @@ static void explosion_map( struct bolt &beam, int x, int y, return; // 3. check to see if we're blocked by something - // specifically, we're blocked by WALLS. Not + // specifically, we're blocked by WALLS. Not // statues, idols, etc. int dngn_feat = grd[beam.target_x + x][beam.target_y + y]; @@ -4206,8 +4186,8 @@ static void explosion_map( struct bolt &beam, int x, int y, // returns true if the beam is harmful (ignoring monster // resists) -- mon is given for 'special' cases where, -// for example, "Heal" might actually hurt undead, or -// "Holy Word" being ignored by holy monsters, etc. +// for example, "Heal" might actually hurt undead, or +// "Holy Word" being ignored by holy monsters, etc. // // only enchantments should need the actual monster type // to determine this; non-enchantments are pretty diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc index 2b13815bd7..a3706fa9fe 100644 --- a/crawl-ref/source/direct.cc +++ b/crawl-ref/source/direct.cc @@ -876,7 +876,7 @@ static char find_square( unsigned char xps, unsigned char yps, onlyVis = (los & LOS_VISIBLE); onlyHidden = (los & LOS_HIDDEN); - const int minx = VIEW_SX, maxx = VIEW_EX, + const int minx = VIEW_SX, maxx = VIEW_EX, miny = VIEW_SY - VIEW_Y_DIFF, maxy = VIEW_EY + VIEW_Y_DIFF, ctrx = VIEW_CX, ctry = VIEW_CY; diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 0beabda197..e2d037fa71 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -129,8 +129,8 @@ static bool treasure_area(int level_number, unsigned char ta1_x, static bool is_weapon_special(int the_weapon); static void set_weapon_special(int the_weapon, int spwpn); static void big_room(int level_number); -static void chequerboard(spec_room &sr, unsigned char - target, unsigned char floor1, unsigned char floor2); +static void chequerboard(spec_room &sr, unsigned char target, + unsigned char floor1, unsigned char floor2); static void roguey_level(int level_number, spec_room &sr); static void morgue(spec_room &sr); @@ -292,7 +292,7 @@ void builder(int level_number, char level_type) } } - // hook up the special room (if there is one, and it hasn't + // hook up the special room (if there is one, and it hasn't // been hooked up already in roguey_level() if (sr.created && !sr.hooked_up) specr_2(sr); @@ -341,7 +341,7 @@ void builder(int level_number, char level_type) if (level_number > 5 && one_chance_in(500 - 5 * level_number)) items_wanted = 10 + random2avg( 90, 2 ); // rich level! - // change pre-rock (105) to rock, and pre-floor (106) to floor + // change pre-rock (105) to rock, and pre-floor (106) to floor replace_area( 0,0,GXM-1,GYM-1, DNGN_BUILDER_SPECIAL_WALL, DNGN_ROCK_WALL ); replace_area( 0,0,GXM-1,GYM-1, DNGN_BUILDER_SPECIAL_FLOOR, DNGN_FLOOR ); @@ -351,7 +351,7 @@ void builder(int level_number, char level_type) // place monsters builder_monsters(level_number, level_type, mon_wanted); - // place shops, if appropriate + // place shops, if appropriate if (player_in_branch( BRANCH_MAIN_DUNGEON ) || player_in_branch( BRANCH_ORCISH_MINES ) || player_in_branch( BRANCH_ELVEN_HALLS ) @@ -3644,7 +3644,7 @@ static bool find_in_area(int sx, int sy, int ex, int ey, unsigned char feature) return (false); } -// stamp a box. can avoid a possible type, and walls and floors can +// stamp a box. can avoid a possible type, and walls and floors can // be different (or not stamped at all) // Note that the box boundaries are INclusive. static bool make_box(int room_x1, int room_y1, int room_x2, int room_y2, @@ -3684,7 +3684,7 @@ static bool make_box(int room_x1, int room_y1, int room_x2, int room_y2, // take care of labyrinth, abyss, pandemonium // returns 1 if we should skip further generation, -// -1 if we should immediately quit, and 0 otherwise. +// -1 if we should immediately quit, and 0 otherwise. static int builder_by_type(int level_number, char level_type) { if (level_type == LEVEL_LABYRINTH) @@ -3740,7 +3740,7 @@ static int builder_by_type(int level_number, char level_type) } // returns 1 if we should skip further generation, -// -1 if we should immediately quit, and 0 otherwise. +// -1 if we should immediately quit, and 0 otherwise. static int builder_by_branch(int level_number) { switch (you.where_are_you) @@ -3987,7 +3987,7 @@ static int builder_normal(int level_number, char level_type, spec_room &sr) } } - // maybe create a special room, if roguey_level hasn't done it + // maybe create a special room, if roguey_level hasn't done it // already. if (!sr.created && level_number > 5 && !done_city && one_chance_in(5)) special_room(level_number, sr); @@ -3995,7 +3995,7 @@ static int builder_normal(int level_number, char level_type, spec_room &sr) return 0; } -// returns 1 if we should skip extras(), otherwise 0 +// returns 1 if we should skip extras(), otherwise 0 static int builder_basic(int level_number) { int temp_rand; @@ -4621,7 +4621,7 @@ static void builder_monsters(int level_number, char level_type, int mon_wanted) while(which_unique < 0 || you.unique_creatures[which_unique]) { - // sometimes, we just quit if a unique is already placed. + // sometimes, we just quit if a unique is already placed. if (which_unique >= 0 && !one_chance_in(3)) { which_unique = -1; @@ -4800,7 +4800,7 @@ static void builder_items(int level_number, char level_type, int items_wanted) // the entire intent of this function is to find a // hallway from a special room to a floor space somewhere, // changing the special room wall (DNGN_BUILDER_SPECIAL_WALL) -// to a closed door, and normal rock wall to pre-floor. +// to a closed door, and normal rock wall to pre-floor. // Anything that might otherwise block the hallway is changed // to pre-floor. static void specr_2(spec_room &sr) @@ -5234,7 +5234,7 @@ static void beehive(spec_room &sr) mons_place( one_chance_in(7) ? MONS_KILLER_BEE_LARVA : MONS_KILLER_BEE, - BEH_SLEEP, MHITNOT, true, x, y ); + BEH_SLEEP, MHITNOT, true, x, y ); } } @@ -7681,7 +7681,7 @@ static int box_room_door_spot(int x, int y) static int box_room_doors( int bx1, int bx2, int by1, int by2, int new_doors) { - int good_doors[200]; // 1 == good spot, 2 == door placed! + int good_doors[200]; // 1 == good spot, 2 == door placed! int spot; int i,j; int doors_placed = new_doors; @@ -7690,7 +7690,7 @@ static int box_room_doors( int bx1, int bx2, int by1, int by2, int new_doors) if ( 2 * ( (bx2 - bx1) + (by2-by1) ) > 200) return 0; - // go through, building list of good door spots, and replacing wall + // go through, building list of good door spots, and replacing wall // with door if we're about to block off another door. int spot_count = 0; @@ -8077,7 +8077,7 @@ static void big_room(int level_number) // helper function for chequerboard rooms // note that box boundaries are INclusive -static void chequerboard( spec_room &sr, unsigned char target, +static void chequerboard( spec_room &sr, unsigned char target, unsigned char floor1, unsigned char floor2 ) { int i, j; @@ -8418,8 +8418,8 @@ void define_zombie( int mid, int ztype, int cs, int power ) if (cls == MONS_PROGRAM_BUG) continue; - // on certain branches, zombie creation will fail if we use - // the mons_rarity() functions, because (for example) there + // on certain branches, zombie creation will fail if we use + // the mons_rarity() functions, because (for example) there // are NO zombifiable "native" abyss creatures. Other branches // where this is a problem are hell levels and the crypt. // we have to watch for summoned zombies on other levels, too, @@ -8478,8 +8478,8 @@ void define_zombie( int mid, int ztype, int cs, int power ) break; } - // every so often, we'll relax the OOD restrictions. Avoids - // infinite loops (if we don't do this, things like creating + // every so often, we'll relax the OOD restrictions. Avoids + // infinite loops (if we don't do this, things like creating // a large skeleton on level 1 may hang the game! if (one_chance_in(5)) relax++; diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 8e539e1aa2..42ecec871f 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -43,7 +43,7 @@ // torment_monsters is called with power 0 because torment is // UNRESISTABLE except for being undead or having torment -// resistance! Even if we used maximum power of 1000, high +// resistance! Even if we used maximum power of 1000, high // level monsters and characters would save too often. (GDL) int torment_monsters(int x, int y, int pow, int caster) diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 3ebeae6505..93de92044b 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -1992,7 +1992,7 @@ void monster_attack(int monster_attacking) return; } - // if a friend wants to help, they can attack <monster_attacking> + // if a friend wants to help, they can attack <monster_attacking> if (you.pet_target == MHITNOT) you.pet_target = monster_attacking; diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 2e634defbc..b5cfb840b9 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -511,7 +511,7 @@ static bool food_change(bool suppress_message) } // end food_change() -// food_increment is positive for eating, negative for hungering +// food_increment is positive for eating, negative for hungering static void describe_food_change(int food_increment) { int magnitude = (food_increment > 0)?food_increment:(-food_increment); diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc index 45d1ba7a36..84041fba62 100644 --- a/crawl-ref/source/hiscores.cc +++ b/crawl-ref/source/hiscores.cc @@ -126,7 +126,7 @@ void hiscores_new_entry( const scorefile_entry &ne ) } } - // special case: lowest score, with room + // special case: lowest score, with room if (!inserted && i < SCORE_FILE_ENTRIES) { newest_entry = i; @@ -685,7 +685,7 @@ static void hs_write( FILE *scores, scorefile_entry &se ) static void hs_parse_string(char *inbuf, struct scorefile_entry &se) { /* old entries are of the following format (Brent introduced some - spacing at one point, we have to take this into account): + spacing at one point, we have to take this into account): // Actually, I believe it might have been Brian who added the spaces, // I was quite happy with the condensed version, given the 80 column @@ -701,7 +701,7 @@ static void hs_parse_string(char *inbuf, struct scorefile_entry &se) 4. All numerics up to the comma are the clevel 5. From the comma, search for known fixed substrings and translate to death_type. Leave death source = 0 for old - scores, and just copy in the monster name. + scores, and just copy in the monster name. 6. Look for the branch type (again, substring search for fixed strings) and level. @@ -917,8 +917,8 @@ static void hs_search_death(char *inbuf, struct scorefile_entry &se) // whew! - // now, if we're still KILLED_BY_MONSTER, make sure that there is - // a "killed by" somewhere, or else we're setting it to UNKNOWN. + // now, if we're still KILLED_BY_MONSTER, make sure that there is + // a "killed by" somewhere, or else we're setting it to UNKNOWN. if (se.death_type == KILLED_BY_MONSTER) { if (strstr(inbuf, "killed by") == NULL) @@ -988,7 +988,7 @@ static void hs_search_where(char *inbuf, struct scorefile_entry &se) return; } - // from here, we have branch and level. + // from here, we have branch and level. char *p = strstr(inbuf, "on L"); if (p != NULL) { @@ -1620,7 +1620,7 @@ std::string scorefile_entry::death_place(death_desc_verbosity verbosity) const if (verbosity == DDV_ONELINE || verbosity == DDV_TERSE) { - snprintf( scratch, sizeof scratch, " (%s)", + snprintf( scratch, sizeof scratch, " (%s)", place_name(get_packed_place(branch, dlvl, level_type), false, true).c_str()); return (scratch); diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 0a7b9ca576..fd03ce64f3 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -337,7 +337,7 @@ void warn_shield_penalties() } // provide a function for handling initial wielding of 'special' -// weapons, or those whose function is annoying to reproduce in +// weapons, or those whose function is annoying to reproduce in // other places *cough* auto-butchering *cough* {gdl} void wield_effects(int item_wield_2, bool showMsgs) @@ -1339,7 +1339,7 @@ bool throw_it(struct bolt &pbolt, int throw_2, monsters *dummy_target) thr.ty = you.y_pos + random2(13) - 6; } - // even though direction is allowed, we're throwing so we + // even though direction is allowed, we're throwing so we // want to use tx, ty to make the missile fly to map edge. pbolt.set_target(thr); @@ -1485,9 +1485,9 @@ bool throw_it(struct bolt &pbolt, int throw_2, monsters *dummy_target) } } - // for all launched weapons, maximum effective specific skill + // for all launched weapons, maximum effective specific skill // is twice throwing skill. This models the fact that no matter - // how 'good' you are with a bow, if you know nothing about + // how 'good' you are with a bow, if you know nothing about // trajectories you're going to be a damn poor bowman. Ditto // for crossbows and slings. @@ -1783,7 +1783,7 @@ bool throw_it(struct bolt &pbolt, int throw_2, monsters *dummy_target) (10 * (you.skills[SK_RANGED_COMBAT] / 2 + you.strength - 10)) / 12; // now, exDamBonus is a multiplier. The full multiplier - // is applied to base damage, but only a third is applied + // is applied to base damage, but only a third is applied // to the magical modifier. exDamBonus = (exDamBonus * (3 * baseDam + ammoDamBonus)) / 30; } @@ -1924,7 +1924,7 @@ bool throw_it(struct bolt &pbolt, int throw_2, monsters *dummy_target) else strcpy(info, "You throw "); - item_name( item, DESC_NOCAP_A, str_pass ); + item_name( item, DESC_NOCAP_A, str_pass ); strcat(info, str_pass); strcat(info, "."); diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index b7560150da..ecc7cff7c0 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -112,7 +112,7 @@ const char *item_name( const item_def &item, char descrip, if (descrip == DESC_INVENTORY_EQUIP || descrip == DESC_INVENTORY) { if (in_inventory(item)) // actually in inventory - snprintf( buff, ITEMNAME_SIZE, (terse) ? "%c) " : "%c - ", + snprintf( buff, ITEMNAME_SIZE, (terse) ? "%c) " : "%c - ", index_to_letter( item.link ) ); else descrip = DESC_CAP_A; diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index c88c5b48d4..96b860a63f 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -108,7 +108,7 @@ void link_items(void) { if (!is_valid_item(mitm[i]) || (mitm[i].x == 0 && mitm[i].y == 0)) { - // item is not assigned, or is monster item. ignore. + // item is not assigned, or is monster item. ignore. mitm[i].link = NON_ITEM; continue; } @@ -2593,9 +2593,9 @@ void handle_time( long time_delta ) int added_contamination = 0; // Account for mutagenic radiation. Invis and haste will give the - // player about .1 points per turn, mutagenic randarts will give - // about 1.5 points on average, so they can corrupt the player - // quite quickly. Wielding one for a short battle is OK, which is + // player about .1 points per turn, mutagenic randarts will give + // about 1.5 points on average, so they can corrupt the player + // quite quickly. Wielding one for a short battle is OK, which is // as things should be. -- GDL if (you.invis && random2(10) < 6) added_contamination++; @@ -2621,7 +2621,7 @@ void handle_time( long time_delta ) { mpr("Your body shudders with the violent release of wild energies!", MSGCH_WARN); - // for particularly violent releases, make a little boom + // for particularly violent releases, make a little boom if (you.magic_contamination > 25 && one_chance_in(3)) { struct bolt boom; @@ -2647,13 +2647,13 @@ void handle_time( long time_delta ) explosion(boom); } - // we want to warp the player, not do good stuff! + // we want to warp the player, not do good stuff! if (one_chance_in(5)) mutate(100); else give_bad_mutation(coinflip()); - // we're meaner now, what with explosions and whatnot, but + // we're meaner now, what with explosions and whatnot, but // we dial down the contamination a little faster if its actually // mutating you. -- GDL contaminate_player( -(random2(you.magic_contamination / 4) + 1) ); diff --git a/crawl-ref/source/libw32c.cc b/crawl-ref/source/libw32c.cc index 7af0c1c517..60062c36ea 100644 --- a/crawl-ref/source/libw32c.cc +++ b/crawl-ref/source/libw32c.cc @@ -302,12 +302,12 @@ void setStringInput(bool value) outmodes = 0; } - if ( SetConsoleMode( inbuf, inmodes ) == 0) { + if ( SetConsoleMode( inbuf, inmodes ) == 0) { fputs("Error initialising console input mode.", stderr); exit(0); } - if ( SetConsoleMode( outbuf, outmodes ) == 0) { + if ( SetConsoleMode( outbuf, outmodes ) == 0) { fputs("Error initialising console output mode.", stderr); exit(0); } @@ -356,7 +356,7 @@ void init_libw32c(void) init_colors(oldTitle); - // by default, set string input to false: use char-input only + // by default, set string input to false: use char-input only setStringInput( false ); if (SetConsoleMode( outbuf, 0 ) == 0) { fputs("Error initialising console output mode.", stderr); @@ -442,7 +442,7 @@ void _setcursortype_internal(int curstype) SetConsoleCursorInfo( outbuf, &cci ); CLOCKOUT(1) - // now, if we just changed from NOCURSOR to CURSOR, + // now, if we just changed from NOCURSOR to CURSOR, // actually move screen cursor if (current_cursor != _NOCURSOR) gotoxy(cx+1, cy+1); @@ -602,7 +602,7 @@ void putch(char c) // translate virtual keys #define VKEY_MAPPINGS 10 -static int vk_tr[4][VKEY_MAPPINGS] = // virtual key, unmodified, shifted, control +static int vk_tr[4][VKEY_MAPPINGS] = // virtual key, unmodified, shifted, control { { VK_END, VK_DOWN, VK_NEXT, VK_LEFT, VK_CLEAR, VK_RIGHT, VK_HOME, VK_UP, VK_PRIOR, VK_INSERT }, { CK_END, CK_DOWN, CK_PGDN, CK_LEFT, CK_CLEAR, CK_RIGHT, CK_HOME, CK_UP, CK_PGUP , CK_INSERT }, @@ -814,8 +814,8 @@ int getConsoleString(char *buf, int maxlen) if (ReadConsole( inbuf, buf, (DWORD)(maxlen-1), &nread, NULL) == 0) fputs("Error in ReadConsole()!", stderr); - // terminate string, then strip CRLF, replace with \0 - buf[maxlen-1] = '\0'; + // terminate string, then strip CRLF, replace with \0 + buf[maxlen-1] = 0; for (unsigned i=(nread<3 ? 0 : nread-3); i<nread; i++) { if (buf[i] == 0x0A || buf[i] == 0x0D) diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index ed278e924a..2007337d43 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -75,8 +75,8 @@ static const char *monster_spell_name[] = { "Throw Frost", "Paralysis", "Slow", - "Haste", - "Confuse", + "Haste", + "Confuse", "Venom Bolt", "Fire Bolt", "Cold Bolt", @@ -95,32 +95,32 @@ static const char *monster_spell_name[] = { "Orb Energy", "Brain Feed", "Level Summon", - "Fake Rakshasa Summon", + "Fake Rakshasa Summon", "Steam Ball", "Summon Demon", "Animate Dead", "Pain", - "Smite", + "Smite", "Sticky Flame", "Poison Blast", "Summon Demon Lesser", "Summon Ufetubus", - "Purple Blast", + "Purple Blast", "Summon Beast", "Energy Bolt", "Sting", "Iron Bolt", - "Stone Arrow", + "Stone Arrow", "Poison Splash", "Summon Undead", - "Mutation", + "Mutation", "Cantrip", "Disintegrate", "Marsh Gas", "Quicksilver Bolt", "Torment", "Hellfire", - "Metal Splinters", + "Metal Splinters", "Summon Demon Greater", "Banishment", "Controlled Blink", @@ -1551,7 +1551,7 @@ int mons_intel_type(int mc) //jmf: new, used by my spells int mons_power(int mc) { - // for now, just return monster hit dice. + // for now, just return monster hit dice. return (smc->hpdice[0]); } diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index 140508d026..11399fa7fe 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -345,7 +345,7 @@ bool place_monster(int &id, int mon_type, int power, char behaviour, proxOK = false; break; } - // swap the monster and the player spots, unless the + // swap the monster and the player spots, unless the // monster was generated in lava or deep water. if (grd[px][py] == DNGN_LAVA || grd[px][py] == DNGN_DEEP_WATER) { @@ -378,8 +378,8 @@ bool place_monster(int &id, int mon_type, int power, char behaviour, id = place_monster_aux( mon_type, behaviour, target, px, py, lev_mons, extra, true); - // now, forget about banding if the first placement failed, or there's too - // many monsters already, or we successfully placed by stairs + // now, forget about banding if the first placement failed, or there's too + // many monsters already, or we successfully placed by stairs if (id < 0 || id+30 > MAX_MONSTERS) return false; @@ -583,7 +583,7 @@ static int place_monster_aux( int mon_type, char behaviour, int target, // setting attitude will always make the // monster wander.. if you want sleeping - // hostiles, use BEH_SLEEP since the default + // hostiles, use BEH_SLEEP since the default // attitude is hostile. if (behaviour > NUM_BEHAVIOURS) { diff --git a/crawl-ref/source/monspeak.cc b/crawl-ref/source/monspeak.cc index 93025ed306..c8899f0528 100644 --- a/crawl-ref/source/monspeak.cc +++ b/crawl-ref/source/monspeak.cc @@ -1291,7 +1291,7 @@ bool mons_speaks(struct monsters *monster) break; case 11: strcat(info, - " says, \"I love to fight, but killing is better.\""); + " says, \"I love to fight, but killing is better.\""); break; } break; // end Erica @@ -2117,7 +2117,7 @@ bool mons_speaks(struct monsters *monster) switch (random2(13)) { case 0: - strcat(info, " roars, \"DIE, PUNY ONE!\""); + strcat(info, " roars, \"DIE, PUNY ONE!\""); break; case 1: strcat(info, " growls, \"YOU BORE ME SO.\""); diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 3158255c32..b1dfe5580e 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -902,7 +902,7 @@ static bool valid_morph( struct monsters *monster, int new_mclass ) { unsigned char current_tile = grd[monster->x][monster->y]; - // morph targets are _always_ "base" classes, not derived ones. + // morph targets are _always_ "base" classes, not derived ones. new_mclass = mons_species(new_mclass); /* various inappropriate polymorph targets */ @@ -1313,7 +1313,7 @@ void behaviour_event( struct monsters *mon, int event, int src, case ME_WHACK: case ME_ANNOY: - // will turn monster against <src>, unless they + // will turn monster against <src>, unless they // are BOTH friendly and stupid. Hitting someone // over the head, of course, always triggers this code. if ( event == ME_WHACK || @@ -1340,7 +1340,7 @@ void behaviour_event( struct monsters *mon, int event, int src, case ME_ALERT: // will alert monster to <src> and turn them - // against them, unless they have a current foe. + // against them, unless they have a current foe. // it won't turn friends hostile either. if (mon->behaviour != BEH_CORNERED) mon->behaviour = BEH_SEEK; @@ -1468,7 +1468,7 @@ static void handle_behaviour(struct monsters *mon) } // unfriendly monsters fighting other monsters will usually - // target the player, if they're healthy + // target the player, if they're healthy if (!isFriendly && mon->foe != MHITYOU && mon->foe != MHITNOT && proxPlayer && !one_chance_in(3) && isHealthy) { @@ -1559,7 +1559,7 @@ static void handle_behaviour(struct monsters *mon) { // if we've arrived at our target x,y // do a stealth check. If the foe - // fails, monster will then start + // fails, monster will then start // tracking foe's CURRENT position, // but only for a few moves (smell and // intuition only go so far) @@ -1627,7 +1627,7 @@ static void handle_behaviour(struct monsters *mon) // by updating target x,y if (mon->foe == MHITYOU) { - // sometimes, your friends will wander a bit. + // sometimes, your friends will wander a bit. if (isFriendly && one_chance_in(8)) { mon->target_x = 10 + random2(GXM - 10); @@ -1679,9 +1679,9 @@ static void handle_behaviour(struct monsters *mon) mon->target_y = 10 + random2(GYM - 10); } - // during their wanderings, monsters will + // during their wanderings, monsters will // eventually relax their guard (stupid - // ones will do so faster, smart monsters + // ones will do so faster, smart monsters // have longer memories if (!proxFoe && mon->foe != MHITNOT) { @@ -1696,7 +1696,7 @@ static void handle_behaviour(struct monsters *mon) new_beh = BEH_SEEK; // smart monsters flee until they can // flee no more... possible to get a - // 'CORNERED' event, at which point + // 'CORNERED' event, at which point // we can jump back to WANDER if the foe // isn't present. @@ -2179,7 +2179,7 @@ static void handle_movement(struct monsters *monster) // reproduced here is some semi-legacy code that makes monsters // move somewhat randomly along oblique paths. It is an exceedingly - // good idea, given crawl's unique line of sight properties. + // good idea, given crawl's unique line of sight properties. // // Added a check so that oblique movement paths aren't used when // close to the target square. -- bwr @@ -2478,7 +2478,7 @@ static bool handle_special_ability(struct monsters *monster, bolt & beem) if (mons_has_ench(monster, ENCH_CONFUSION)) break; - // friendly fiends won't use torment, preferring hellfire + // friendly fiends won't use torment, preferring hellfire // (right now there is no way a monster can predict how // badly they'll damage the player with torment) -- GDL if (one_chance_in(4)) @@ -2544,12 +2544,12 @@ static bool handle_special_ability(struct monsters *monster, bolt & beem) if (!mons_near(monster)) break; - // the fewer spikes the manticore has left, the less + // the fewer spikes the manticore has left, the less // likely it will use them. if (random2(16) >= static_cast<int>(monster->number)) break; - // do the throwing right here, since the beam is so + // do the throwing right here, since the beam is so // easy to set up and doesn't involve inventory. // set up the beam @@ -3477,7 +3477,7 @@ static bool handle_throw(struct monsters *monster, bolt & beem) return (false); // recent addition {GDL} - monsters won't throw if they can do melee. - // wastes valuable ammo, and most monsters are better at melee anyway. + // wastes valuable ammo, and most monsters are better at melee anyway. if (adjacent( beem.target_x, beem.target_y, monster->x, monster->y )) return (false); @@ -4477,7 +4477,7 @@ static void monster_move(struct monsters *monster) // we're hostile (even if we're heading somewhere // else) - // smacking another monster is good, if the monsters + // smacking another monster is good, if the monsters // are aligned differently if (mgrd[targ_x][targ_y] != NON_MONSTER) { @@ -4552,7 +4552,7 @@ static void monster_move(struct monsters *monster) continue; break; - // this isn't harmful, but dumb critters might think so. + // this isn't harmful, but dumb critters might think so. case CLOUD_GREY_SMOKE: case CLOUD_GREY_SMOKE_MON: if (mons_intel(monster->type) > I_ANIMAL || coinflip()) @@ -4652,10 +4652,10 @@ static void monster_move(struct monsters *monster) } - // now, if a monster can't move in its intended direction, try - // either side. If they're both good, move in whichever dir + // now, if a monster can't move in its intended direction, try + // either side. If they're both good, move in whichever dir // gets it closer(farther for fleeing monsters) to its target. - // If neither does, do nothing. + // If neither does, do nothing. if (good_move[mmov_x + 1][mmov_y + 1] == false) { int current_distance = grid_distance( monster->x, monster->y, @@ -4679,7 +4679,7 @@ static void monster_move(struct monsters *monster) int dist[2]; - // first 1 away, then 2 (3 is silly) + // first 1 away, then 2 (3 is silly) for (int j = 1; j <= 2; j++) { int sdir, inc; diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc index cd68e70cc9..d479c75374 100644 --- a/crawl-ref/source/mstuff2.cc +++ b/crawl-ref/source/mstuff2.cc @@ -1150,8 +1150,8 @@ bool mons_throw(struct monsters *monster, struct bolt &pbolt, int hand_used) if (mons_intel(monster->type) == I_HIGH) exHitBonus += 10; - // now, if a monster is, for some reason, throwing something really - // stupid, it will have baseHit of 0 and damage of 0. Ah well. + // now, if a monster is, for some reason, throwing something really + // stupid, it will have baseHit of 0 and damage of 0. Ah well. strcpy(info, ptr_monam( monster, DESC_CAP_THE) ); strcat(info, (launched) ? " shoots " : " throws "); diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index cbdc6845ab..97718a3691 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -444,8 +444,8 @@ bool new_game(void) you.is_undead = ((you.species == SP_MUMMY) ? US_UNDEAD : (you.species == SP_GHOUL) ? US_HUNGRY_DEAD : US_ALIVE); - // before we get into the inventory init, set light radius based - // on species vision. currently, all species see out to 8 squares. + // before we get into the inventory init, set light radius based + // on species vision. currently, all species see out to 8 squares. you.normal_vision = 8; you.current_vision = 8; @@ -3044,7 +3044,7 @@ spec_query: return true; } -// returns true if a class was chosen, false if we should go back to +// returns true if a class was chosen, false if we should go back to // race selection. bool choose_class(void) diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 3bd2f8d2e1..9d510e9216 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -643,7 +643,7 @@ void get_full_detail(char* buffer, bool calc_unid) } else { - snprintf(CUR_AD, "HP : %3d/%d (%d)", + snprintf(CUR_AD, "HP : %3d/%d (%d)", you.hp, you.hp_max, you.hp_max + player_rotted() ); } diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index b5023cd8b0..8fbd11ac3d 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -374,7 +374,7 @@ int animate_dead( int power, int corps_beh, int corps_hit, int actual ) return number_raised; } // end animate_dead() -int animate_a_corpse( int axps, int ayps, int corps_beh, int corps_hit, +int animate_a_corpse( int axps, int ayps, int corps_beh, int corps_hit, int class_allowed ) { if (igrd[axps][ayps] == NON_ITEM) diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index ded812df5e..1c665cec12 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -2702,7 +2702,7 @@ void cast_twist(int pow) if (pow > 25) pow = 25; - // Get target, using DIR_TARGET for targetting only, + // Get target, using DIR_TARGET for targetting only, // since we don't use fire_beam() for this spell. if (spell_direction(targ, tmp, DIR_TARGET) == -1) return; @@ -2754,7 +2754,7 @@ void cast_far_strike(int pow) struct dist targ; struct bolt tmp; // used, but ignored - // Get target, using DIR_TARGET for targetting only, + // Get target, using DIR_TARGET for targetting only, // since we don't use fire_beam() for this spell. if (spell_direction(targ, tmp, DIR_TARGET) == -1) return; @@ -3061,8 +3061,8 @@ static int quadrant_blink(int x, int y, int pow, int garbage) // setup: Brent's new algorithm // we are interested in two things: distance of a test point from - // the ideal 'line', and the distance of a test point from two - // actual points, one in the 'correct' direction and one in the + // the ideal 'line', and the distance of a test point from two + // actual points, one in the 'correct' direction and one in the // 'incorrect' direction. // scale distance by 10 for more interesting numbers. diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc index 101b8d6f07..4f6e040563 100644 --- a/crawl-ref/source/spl-book.cc +++ b/crawl-ref/source/spl-book.cc @@ -1509,7 +1509,7 @@ int staff_spell( int staff ) if (!is_valid_spell_in_book( staff, spell )) goto whattt; - specspell = which_spell_in_book( type, spell ); + specspell = which_spell_in_book( type, spell ); if (specspell == SPELL_NO_SPELL) goto whattt; diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc index 34d7c48933..020e5fa0c2 100644 --- a/crawl-ref/source/spl-util.cc +++ b/crawl-ref/source/spl-util.cc @@ -65,7 +65,7 @@ void init_playerspells(void) for (x = 0; x < NUM_SPELLS; x++) plyrspell_list[x] = -1; - // can only use up to PLYRSPELLDATASIZE _MINUS ONE_, or the + // can only use up to PLYRSPELLDATASIZE _MINUS ONE_, or the // last entry tries to set plyrspell_list[SPELL_NO_SPELL] // which corrupts the heap. for (x = 0; x < PLYRSPELLDATASIZE - 1; x++) diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc index f09851b52a..653f0bfcc9 100644 --- a/crawl-ref/source/stash.cc +++ b/crawl-ref/source/stash.cc @@ -695,7 +695,7 @@ std::string ShopInfo::description() const return (name); } -bool ShopInfo::matches_search(const std::string &prefix, +bool ShopInfo::matches_search(const std::string &prefix, const base_pattern &search, stash_search_result &res) const { diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc index 4e33dc2f0c..e9b97624ea 100644 --- a/crawl-ref/source/stuff.cc +++ b/crawl-ref/source/stuff.cc @@ -144,8 +144,8 @@ void tag_followers( void ) if (fmenv->speed_increment < 50) continue; - // only friendly monsters, or those actively seeking the - // player, will follow up/down stairs. + // only friendly monsters, or those actively seeking the + // player, will follow up/down stairs. if (!(mons_friendly(fmenv) || (fmenv->behaviour == BEH_SEEK && fmenv->foe == MHITYOU))) { diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index 3ed5734355..789451f3a2 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -17,7 +17,7 @@ than anything else, it is not actually saved as a tag) to TAG_XXX. NUM_TAGS is equal to the actual number of defined tags. -2. Tags are created with tag_construct(), which forwards the construction +2. Tags are created with tag_construct(), which forwards the construction request appropriately. tag_write() is then used to write the tag to an output stream. @@ -25,15 +25,15 @@ forwards the request appropriately, returning the ID of the tag it found, or zero if no tag was found. -4. In order to know which tags are used by a particular file type, a client +4. In order to know which tags are used by a particular file type, a client calls tag_set_expected( fileType ), which sets up an array of chars. Within the array, a value of 1 means the tag is expected; -1 means that the tag is not expected. A client can then set values in this array to anything other than 1 to indicate a successful tag_read() of that tag. 5. A case should be provided in tag_missing() for any tag which might be - missing from a tagged save file. For example, if a developer adds - TAG_YOU_NEW_STUFF to the player save file, he would have to provide a + missing from a tagged save file. For example, if a developer adds + TAG_YOU_NEW_STUFF to the player save file, he would have to provide a case in tag_missing() for this tag since it might not be there in earlier savefiles. The tags defined with the original tag system (and so not needing cases in tag_missing()) are as follows: @@ -487,7 +487,7 @@ int tag_read(FILE *fp, char minorVersion) // For now, none are supported. // This function will be called AFTER all other tags for -// the savefile are read, so everything that can be +// the savefile are read, so everything that can be // initialized should have been by now. // minorVersion is available for any child functions that need @@ -539,12 +539,12 @@ void tag_set_expected(char tags[], int fileType) } } -// NEVER _MODIFY_ THE CONSTRUCT/READ FUNCTIONS, EVER. THAT IS THE WHOLE POINT +// NEVER _MODIFY_ THE CONSTRUCT/READ FUNCTIONS, EVER. THAT IS THE WHOLE POINT // OF USING TAGS. Apologies for the screaming. // Note anyway that the formats are somewhat flexible; you could change map -// size, the # of slots in player inventory, etc. Constants like GXM, -// NUM_EQUIP, and NUM_DURATIONS are saved, so the appropriate amount will +// size, the # of slots in player inventory, etc. Constants like GXM, +// NUM_EQUIP, and NUM_DURATIONS are saved, so the appropriate amount will // be restored even if a later version increases these constants. // --------------------------- player tags (foo.sav) -------------------- // @@ -774,7 +774,7 @@ static void tag_construct_you_items(struct tagHeader &th) marshallByte(th, 50); // this is really dumb. We copy the id[] array from itemname - // to the stack, for no good reason that I can see. + // to the stack, for no good reason that I can see. char identy[4][50]; save_id(identy); @@ -1771,8 +1771,8 @@ static void tag_read_level_monsters(struct tagHeader &th, char minorVersion) menv[i].target_y = unmarshallByte(th); menv[i].flags = unmarshallByte(th); - // VERSION NOTICE: for pre 4.2 files, flags was either 0 - // or 1. Now, we can transfer ENCH_CREATED_FRIENDLY over + // VERSION NOTICE: for pre 4.2 files, flags was either 0 + // or 1. Now, we can transfer ENCH_CREATED_FRIENDLY over // from the enchantments array to flags. // Also need to take care of ENCH_FRIEND_ABJ_xx flags @@ -1855,7 +1855,7 @@ void tag_missing_level_attitude() // a foe first time through handle_monster() if // there's one around. - // as for attitude, a couple simple checks + // as for attitude, a couple simple checks // can be used to determine friendly/neutral/ // hostile. int i; diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 486d961049..3339341caf 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -702,9 +702,9 @@ bool check_awaken(int mons_aw) + mons_see_invis(monster) * 5; // critters that are wandering still have MHITYOU as their foe are - // still actively on guard for the player, even if they can't see + // still actively on guard for the player, even if they can't see // him. Give them a large bonus (handle_behaviour() will nuke 'foe' - // after a while, removing this bonus. + // after a while, removing this bonus. if (monster->behaviour == BEH_WANDER && monster->foe == MHITYOU) mons_perc += 15; @@ -968,7 +968,7 @@ bool noisy( int loudness, int nois_x, int nois_y, const char *msg ) #define LOS_MAX_RANGE 9 // the following two constants represent the 'middle' of the sh array. -// since the current shown area is 19x19, centering the view at (9,9) +// since the current shown area is 19x19, centering the view at (9,9) // means it will be exactly centered. // This is done to accomodate possible future changes in viewable screen // area - simply change sh_xo and sh_yo to the new view center. |