--- crossfire/common ---


Protocol:pserver User:anonymous
Machine:crossfire.cvs.sourceforge.net CVSROOT:/cvsroot/crossfire

Filename: item.c
Revision 1.65akirschbaum 2006/07/27 17:37:17 +4 -4
common/item.c: In describe_item() correct capacity description of large
(>1000 maxsp) Glowing Crystals.
Show difference between Revision 1.64 and 1.65
Revision 1.64tchize 2006/07/02 10:32:34 +2 -2

more progress in unit testing, marked points of interrest in code
Show difference between Revision 1.63 and 1.64
Revision 1.63mwedel 2006/06/05 01:28:55 +4 -4
Clean up some compiler warnings. Most of the changes are related to replaced
%lld with FMT64 defines so that the format will be correct, no matter if
the 64 bit type is a long, long long, or if this is windows. #if 0 out a
bunch of code that isn't used.
--
common/exp.c: Replaced lld with FMT64
common/holy.c: #if 0 out baptize_altar(). Add banner copyright at top of file.
common/info.c, common/item.c, common/loader.l, common/loader.c, common/map.c:
common/porting.c Replaced lld with FMT64
common/time.c: Replace a bunch of variables declared as longs to be uint32.
Update various sprintf appropriately.
include/global.h: Add FMT64 and FMT64U as appropriate for different systems.
Change max_time to be a uint32
include/sockproto.h, include/sproto.h: rebuilt
server/apply.c: #if 0 out monster_apply_special
server/c_range.c: Add != 0 in assignment if statement - same meaning, clearer
on intention and avoids compiler warning.
server/c_wiz.c: Update command_kick() to take const char. Update command_speed()
to operate properly based on max_time being a uint32. Update various lld
to FMT64. Clarify ambiguous if/if/else statement in command_insert_into()
server/commands.c: Add cast to command_kick for new function prototype. #if
0 out find_command(), parse_string(), parse_command()
server/disease.c: #if 0 out find_disease(), reduce_symptoms()
server/egoitem.c: #if 0 out create_artifact(). Add copyright at top of file.
server/gods.c: #if 0 out get_god()
server/hiscore.c: Replace lld with FMT64
server/login.c: #if 0 out create_savedir_if_needed()
server/resurrection.c: Replace lld with FMT64. #if 0 out dead_character() and
dead_player_exists()
server/server.c: Remove info_keys() - hasn't been used in a long time. #if 0
out process_active_maps()
server/skill_util.c: Replace lld with FMT64
server/spell_util.c: #if 0 out check_spell_effect()
server/weather.c: #if 0 out feather_map(). Fix what I suspect is an error
in worldmap_to_weathermap() to skip over starting slashes.
socket/image.c: Add a fair number of char * casts to suppress warnings.
socket/init.c: Change buflen in init_connection() to socklen_t to match
function prototype. Add some char * casts.
socket/loop.c: Add some char * casts.
--
MSW 2006-06-04
Show difference between Revision 1.62 and 1.63
Revision 1.62akirschbaum 2006/05/21 07:27:46 +7 -3
Skip some processing if NEW_MATERIAL_CODE is undefined.
Show difference between Revision 1.61 and 1.62
Revision 1.61ryo_saeba 2006/05/05 04:47:40 +2 -2
Third and last part of patch #1453869 courtesy Stefan Huehner (shuehner)
Show difference between Revision 1.60 and 1.61
Revision 1.60ryo_saeba 2006/03/18 11:15:24 +5 -5
Use const when possible. Patch courtesy Stefan Huehner.
Show difference between Revision 1.59 and 1.60
Revision 1.59ryo_saeba 2006/03/18 09:05:31 +23 -46
Massive cleaning of code. Shouldn't be any functional change.
Show difference between Revision 1.58 and 1.59
Revision 1.58akirschbaum 2006/02/22 03:47:35 +1 -2
Remove object type CONFUSION since it was not used anymore.
Show difference between Revision 1.57 and 1.58
Revision 1.57akirschbaum 2006/02/08 18:48:36 +12 -12
Apply patch #1427979 (code-cleanup: add const, fix warnings) by Stefan
Huehner.
Show difference between Revision 1.56 and 1.57
Revision 1.56akirschbaum 2006/01/07 12:56:51 +4 -4
Use named constants instead of numbers.
Show difference between Revision 1.55 and 1.56
Revision 1.55mwedel 2005/11/16 02:16:00 +15 -7
Commit for new blocking code. Not going to dictate all the changes -
but will outline the broad points. Note also that the
doc/Developers/objects is updated and goes into more details also.
- check for P_WALL no longer used - instead, need to use GET_MAP_MOVE_BLCOK
and check against movement type of objects.
- arch_blocked() changed to ob_blocked(), now takes object. Needed because
just looking at archetype move_ values is no longer sufficient.
- find_first_free_spot() changed to take object, since it just calls
arch_blocked()
- FLAG_FLYING removed, now in move type.
- walk_on/walk_off/fly_on/fly_off removed - now based on move_on and
move_off fields.
- Map space structure extended to hold the move_on/move_off, etc
values so that we can shortcut some processing by not having to
check every object on the space when something enters it if
move_on isn't set.
- archetypes recollected - boulders needed move_walk to properly trigger
buttons.
- Note that the new plugin code has to be fixed up for the new movement
code. Look for FIXME in plugins/cfpython/cfpython_object.c
MSW 2005-11-15
Show difference between Revision 1.54 and 1.55
Revision 1.54akirschbaum 2005/10/28 14:08:53 +2 -2
Fix compiler warnings. Most changes do not change the program (remove unused
variables, convert "if(x = y)" into "x = y; if(x)"); a few actually fix
(possible) problems (fix uninitialized variables, fix printf format
specifiers, fix mismatches between signed and unsigned variables, add missing
return and default statements).
Show difference between Revision 1.53 and 1.54
Revision 1.53cavesomething 2005/10/21 14:03:24 +2 -2
make shops check if a player can afford all items, before buying any of them
Show difference between Revision 1.52 and 1.53
Revision 1.52ryo_saeba 2005/10/08 04:56:43 +1 -2
Removed gps code. Added GetMarkedItem to Python
Show difference between Revision 1.51 and 1.52
Revision 1.51cavesomething 2005/10/02 22:29:41 +161 -1
add support for specialised shops
Show difference between Revision 1.50 and 1.51
Revision 1.50tchize 2005/09/03 14:15:45 +27 -2

Added glowing crystal charge/max charge information in description.
See RFE #1241712 on sourceforge
http://sourceforge.net/tracker/index.php?func=detail&aid=1241712&group_id=13833&atid=363833
Show difference between Revision 1.49 and 1.50
Revision 1.49ryo_saeba 2005/08/12 08:46:34 +3 -3
Fields changed from char* to const char*, cleanup.
Show difference between Revision 1.48 and 1.49
Revision 1.48ryo_saeba 2005/07/15 08:51:48 +2 -2
Glue cleaning. New plugin function.
Show difference between Revision 1.47 and 1.48
Revision 1.47ryo_saeba 2005/04/15 15:56:38 +2 -2
New item type: 163 item transformer, see doc
Show difference between Revision 1.46 and 1.47
Revision 1.46akirschbaum 2004/06/12 14:09:35 +2 -2
Set type of variable holding a weight to sint32.
Show difference between Revision 1.45 and 1.46
Revision 1.45mwedel 2004/06/11 02:23:37 +3 -1
common/item.c: describe_monster() - if the creature/player is stealthy,
mention it when the object is described.
common/loader.l, loader.c: Fix passed in size to get_ob_diff() - was one
to long, causing string corruption.
server/spell_attack.c: mood_change() - fix get_map_ob call - wasn't using
correct coordinate variables, resulting in crash.
MSW 2004-06-10
Show difference between Revision 1.44 and 1.45
Revision 1.44mwedel 2004/05/04 02:14:53 +5 -1
common/item.c: describe_monster() - print luck when describing players (fixex
perceive self not showing luck)
server/attack.c: kill_object() - don't give player exp if he kills himself -
compare owner against what was killed, not the hitter.
server/pets.c: summon_object() - move breaking out for last treasurelist
after we set the last valid treasurelist - otherwise, the list entry for
the treasurelist was never used. Change summoned creatures so that
the items they have are god given, and thus disappear when they
are killed - prevents players from summoning and then looting their pets.
server/spell_attack.c: explode_bullet() - Get owner of the spell so that we
can properly tailor the explosion portion of the spell for the god
of the worshipper.
MSW 2004-05-03
Show difference between Revision 1.43 and 1.44
Revision 1.43mwedel 2004/04/26 00:07:52 +2 -1
common/item.c, server/c_object.c: Fix code so that skill tools (talismans,
holy symbols, etc) are properly describe. Clean up formatting of long_desc()
MSW 2004-04-25
Show difference between Revision 1.42 and 1.43
Revision 1.42mwedel 2004/04/08 01:48:51 +2 -2
common/item.c: If potion wasn't given a random spell, use the archetype
name when it is identified.
common/treasure.c: Fix potion codes so that healing and magic power potions
get the proper spell inserted into them. Also fix line termination issue.
server/skill_util.c: Add check in skill_attack() to make sure current_weapon
is not null - there has been some crashes here, but I can't figure out
how it gets to this state, so better to at least handle it.
MSW 2004-04-07
Show difference between Revision 1.41 and 1.42
Revision 1.41akirschbaum 2004/03/07 04:04:20 +2 -11
common/item.c: Fixed calc_item_power() to return valid item power for
items with high enchantments.
Andreas Kirschbaum 2004-03-07
Show difference between Revision 1.40 and 1.41
Revision 1.40ryo_saeba 2004/02/28 04:40:56 +3 -1
Warning cleaning
Show difference between Revision 1.39 and 1.40
Revision 1.39ryo_saeba 2003/12/18 14:39:44 +4 -4
GCC 3.3 infinite loop fixes
Show difference between Revision 1.38 and 1.39
Revision 1.38mwedel 2003/09/13 00:01:27 +117 -141
Updated code for skill + spell code. skills and spells are now objects.
tuning these now means changing the archetypes. New spells can now
be added just by making a new archetype. Lots of code cleanup
also done.
MSW 2003-09-12
Show difference between Revision 1.37 and 1.38
Revision 1.37mwedel 2003/05/21 02:31:13 +7 -1
common/item.c, common/utils.c, include/config.h: Add #define NEW_MATERIAL_CODE
and checks in the other files for this - if this is commented out
(default), then the new material naming code is disabled - material
names won't be put in the items names as shown in the inventory
(can still see material by examining an object), and objects that are
created will be created with the default material (eg, iron for
most armor/weapons, eg, brass, bronze, copper items won't show
up anymore).
lib/settings: Add comments from the old config.h file that describes
what the options already does. Having no comments in this file
or in config.h anymore is very unfriendly.
MSW 2003-05-20
Show difference between Revision 1.36 and 1.37
Revision 1.36mwedel 2003/03/07 23:35:32 +3 -3
Patch for 64 bit experience total, as well as flexible number of levels.
Basically, max level is now dynamic, set in exp_table file. Experience
is now a 64 bit value, so much higher totals now allowed. To
allow for flexible levels, add new function - did_make_save() which is used
for players/monsters to see if they make their saving throw - this is
necessary because the savethrow[] array may not be as large as max level -
did_make_save takes this into account.
NOTE: If your updating a server, you will need to copy over/set up a
new exp_table file that has max_levels defined and at least one of the
tables uncommented. There are no longer any compiled in defaults
--
configure, configure.ac: Add AC_CHECK_SIZEOF calls for long and long long
so we can know which one to use for 64 bit support (other checks
may need to be added)
common/exp.c: Remove levels table, replace it with a 64 bit pointer.
Change init_experience to allocate appropriately sized table, have it
read max_level value from exp_table file. Replace atoi calls with
atoll to get 64 bit value. Update dump_experience to properly
print 64 bit values.
common/info.c: Update dump routines that dump exp to properly print
64 bit values.
common/init.c: Add initializing for settings.max_level value.
common/item.c: Update sprintf's to handle 64 bit output of exp (speed)
value in objects.
common/living.c: change MAX_EXP define, update MAX_EXP_IN_OBJ define,
add MAX_SAVE_LEVEL which corresponds to how large the savethrow
table is. Change MAXLEVEL to settings.max_level. Change level_exp()
to return 64 bit value, other updates in functions to use 64 bit
values. Add did_make_save() function.
common/loader.l, common/loader.c: Update load/save routins of exp to
deal with 64 bit values.
common/map.c: Update calculate_difficulty to use 64 bit values when
storing exp - unlikely to make a difference, since unlikely any map
will get to a point where it has that much exp on it.
common/porting.c: Remove dead code from save_long(), add save_long_long()
to save 64 bit values.
include/autoconf.h.in: SIZEOF_LONG and SIZEOF_LONG_LONG values added.
include/global.h: Add code to typedef sint64/uint64 types based on what
type gives us those values. Add max_level to settings array.
include/libproto.h: rebuilt.
include/living.h: Replace exp field with 64 bit value.
include/player.h: Update party kill log exp tracking to have 64 bit
values.
lib/exp_table: Udpate comments about max_level, uncomment what
was the default table so new installs have working table.
Add 5 levels to all the tables.
random_maps/monster.c: Update place_monsters to use 64 bit when storing
exp total for map/per square.
server/apply.c: Replace MAXLEVEL with settings.max_level, add
did_make_save calls where appropriate
server/c_misc.c: have statistics command properly print 64 bit
exp value.
server/c_wiz.c: Have stats command properly display 64 bit value.
server/hiscore.c: Replace exp values with 64 bit values, update to
properly load/display them.
server/player.c: replace savethrow[] reference with did_make_save()
server/skill_util.c: Update skills command to properly show 64 bit exp values.
server/spell_effect.c: replace savethrow[] reference with did_make_save(),
allow players to cast directors right beneath themselves, but other
walls must be on empty space.
MSW 2003-03-07
Show difference between Revision 1.35 and 1.36
Revision 1.35garbled 2003/02/13 23:50:28 +14 -6
Lots of updates here:
common/item.c: make item_power stop showing up in ring short descriptions.
fix some of the items that were double-displaying materialnames, like
mithril mithril chainmail.
common/loader.l: add tooltype
common/utils.c: Unless the object is armour or weapons, pick the first
materialname we find. Now, newly generated diamonds will stack.
Fix name_to_material to return NULL if it finds nothing, fixes
navar_city/museum crash.
Change set_materialname to take a materialtype_t argument, allowing
functions to manually set the materialname, rather than let the
randomizer pick for them.
include/define.h: Add TOOL and BUILDFAC for item building.
include/object.h: add tooltype for item building.
include/materials.h: add M_SPECIAL. Set this in an object, to prevent things
like mithril mithril chainmail. This is primarily only needed in
artifacts, because they change the base material of the arch. Also
useful in things like the demonspawn shield, and on maps.
lib/artifacts: sprinkle M_SPECIAL around.
server/player.c: remove auto_heal. This never should have been
committed, and was never referenced by any code.
server/c_object.c: add item building, but add it disabled. Too many
bugfixes were tied in with this code to cleanly add them. When
enabled, this code will add player item building, similar to
create to take place. Requires a host of graphics and arches
to be useable.
Show difference between Revision 1.34 and 1.35
Revision 1.34garbled 2003/02/07 00:57:16 +29 -6
Mark clued me in that query_name existed.. and that brought to light that
the way I was handling materialnames before was stupid. Back the old
code out, and use query_name instead. Put something in the loader to
back the names out of the objects I mangled.
Show difference between Revision 1.33 and 1.34
Revision 1.33garbled 2003/01/29 18:07:07 +5 -5
New materialtype system for crossfire. Based in concept on my original
design, but rewritten from scratch to make it easily extensible.

In a nutshell:

Each of the old materialtypes (metal, glass, stone, wood) are now a class
of materials. When an item in the game is created, if it does not have a
specific materialname of it's own, a materialname is generated randomly
from the matching entries in the "lib/materials" file. This file
contains all of the saving throws, and other material specific
modifications for each of the expanded materials.

Materials can be manually specified in the arch with the "materialname"
directive. Such as the gold coins, which are specified to be made of,
you guessed it, gold.

Saving throws have been slightly rewritten to use the new materialtypes,
and a few other minor details associated with materialtypes have been
patched up.

Adding a new type of stone or wood, is as simple as adding a new entry in
the lib/materials file. The game will automatically start distributing
them around randomly.
Show difference between Revision 1.32 and 1.33
Revision 1.32mwedel 2003/01/27 01:34:34 +2 -2
Various bug fixes:
common/item.c: If nrof of an item is 0, have it print singular name and
not plural name.
server/c_object.c: Fix typo when printing value of optoins - had an
extra 'the' in place. Also, don't print value of objects with
no pick flag set.
server/login.c: Enforce maximum name length for new characters.
server/monster.c: Change parsing code for messages/@match code -
new code is simpler, and should also be simpler and less bug
ridden, but otherwise functionally equivalant. Also fix up
communicate to work properly on tiled maps.
server/spell_effect.c: fix up move_aura to not crash hopefully.
MSW 2003-01-26
Show difference between Revision 1.31 and 1.32
Revision 1.31mwedel 2003/01/17 00:23:54 +4 -3
More bug fixes:
common/item.c: Add missing braces - was resulting in some items getting
display like 'gauntlets of strength (Str+1)(Str+1).
include/map.h: Add MAGIC_MAP definitions to the file.
server/shop.c: Put back in code that uses magic_mapping_mark to determine
what items to display in inventory. Update for new one magic mapping
code stores information away.
server/spell_util.c: Add missing P_OUT_OF_FLAG check, which resulted
in crashes.
socket/info.c: Move MAGIC_MAP definations to map.h. Add check for
P_OUT_OF_MAP. Remove code that stops on P_NO_MAGIC - with that
it wouldn't search the shops.
MSW 2003-01-16
Show difference between Revision 1.30 and 1.31
Revision 1.30mwedel 2003/01/05 17:50:10 +7 -6
common/item.c: Add 'unidentified' to display of examined items if the
item has not been identified. Only display spell regen penalty
for armour if there is in fact a penalty.
lib/archetypes: rebuilt for updated demon speed, pick up other new archs.
lib/animations, lib/bmaps lib/bmaps.paths lib/crossfire.0 lib/crossfire.1
lib/faces: rebuilt
server/main.c: Name random maps based on final map component (if available)
or map they are spawned from - this gives so clue in 'who' command
where the players really are.
server/monster.c: Fix code that would cause monsters to ignore golems/
avatars.
server/pets.c: Clean up a few warnings, fix bug in pet_move that caused
crashes - owner of a pet isn't always a player.
server/player.c: Remove on_same_map check - can_detect_monster also
performed check, so no need to have extra call.
server/spell_effect.c: modify alchemy to properly deal with tiled maps,
change behavior for spells that block view - they no longer block
alchemy, but spaces that block magic will.
MSW 2002-01-05
Show difference between Revision 1.29 and 1.30
Revision 1.29garbled 2002/11/13 19:03:59 +1 -9
FULL_RING_DESCRIPTION is default. Nuke the define from orbit.
Show difference between Revision 1.28 and 1.29
Revision 1.28mwedel 2002/10/04 00:59:28 +3 -2
common/item.c: Fix bug with identified potions not getting set to proper name.
MSW 2002-10-03
Show difference between Revision 1.27 and 1.28
Revision 1.27mwedel 2002/09/24 01:29:31 +2 -2
Fix error of passing null value to LOG in item power diagnostics.
MSW 2002-09-23
Show difference between Revision 1.26 and 1.27
Revision 1.26mwedel 2002/08/11 02:52:15 +3 -1
More spoiler-html fixes - was not including attacktype information, but
also fixed some formatting issues.
common/item.c: Include attacktypes in describe_monster.
doc/scripts/Makefile.in: Add monsters-extract.pl file.
doc/spoiler-html/Makefile.in: Update to use ../scripts/monster-extract.pl
file, remove monster-extract file.
doc/spoiler-html/spoiler.html: rebuilt.
MSW 2002-08-11
Show difference between Revision 1.25 and 1.26
Revision 1.25mwedel 2002/08/03 00:04:14 +8 -1
common/item.c: Have describe monster show resistances of monsters - useful
for spoiler output, as well probe spell.
server/disease.c: Fix typo.
MSW 2002-08-02
Show difference between Revision 1.24 and 1.25
Revision 1.24mwedel 2002/07/14 23:57:11 +164 -12
-- Start body commit notes --
Major commit. This adds body locations which is used for equipping items.
Equipment has information which body part it gets equipped to, and monsters
have information on how which body locations they can have.

As part of this work, I also did a lot of code cleanup.

To use this, you must use up to date archetypes - the ones included
in this commit are fine - just make sure you install them. If
you don't, players will not be able to equip items.

common/arch.c: Initialize body_used to be same as body_info for
archetypes - this way when monsters are created, they can
start equipping items right away.
common/exp.c: update new_exp() - some flags it checked for before no longer
exist or have new names.
common/info.c: describe_item() now takes second parameter - update
dump_abilities to use new calling convention.
common/item.c: Add table that describes the body_info locations and
their names. Add functions that calculate item power for objects
that don't have it set. Update display functions to show
item_power in items. Update describe_monster() - use_horn/wand/rod
merged into just use_range. Modify describe_item() to take second
paramater - who the item is being described for. Show item_power
in describe_item.
common/living.c: Pull out MAXLEVEL from being defined in this file -
define in in define.h, since other files use it. Add NUM_STATS
define - replace hard coded values of having just 7 stats with it.
Update change_abil to not display that the player has a new
attacktype when equipping a bow that has it - fix_player() ignores
the attacktype of the bow, so it was incorrect information.
fix_player(): Initialize player ranges structure to null -
will get filled in by code in function, updated to deal with
updating the body_used data from body_info in the objects.
Replace instances of last_heal with gen_sp_armour. Rearrange
some code to make function more readable.
common/loader.c, common/loader.l: Remove the variable_const information - no
longer needed and confusing for new people when adding in new object
elements. Add set_body_info() - parses the string from the load file and
sets the appropriate array element. Add check_loaded_object() - does
sanity checking for an object after finished loading - replaces need for
long processing directive in the actual rules by having seperate function.
Remove unused flags from load directives (apply_once, no_pretext,
can_apply), add some new ones (item_power, gen_sp_armour), update others
to can_use_range. Replace flag_links with simple array that contains the
name for each corresponding flag. Update get_ob_diff to not use the V_
values and just include the actual string name - all recent changes have
done this, just updated for old stuff. Update get_ob_diff to save new
values that have been added.
common/object.c: clear_object: Modify to use memset to clear
the structure to zero - this is less error prone than listing
all the specific values, and probably faster. Also, makes it
easier to add new elements - no need to update object.c in most
cases.
common/player.c: Remove get_player_ob routine - this is now merged
in with get_player_ob in server/player.c. Remove generate_ext_title -
not used.
common/readable.c: Update to pass second argument to describe_item.
common/treasure.c: Update to calculate item_power of generated items.
Clean up a lot of code formatting. Update add_abilities
to use gen_sp_armour values, not last heal (note, it appears
the last_heal values weren't being used before). Update
calls to describe item to take second parameter.
doc/Developers/objects: Update will_apply notes, add note about
item_power, body location.
include/define.h: Comment out unused flags (flag_apply_once, flag_paralyzed,
flag_no_pretext, flag_ready_rod, flag_read_horn). Add flag_use_shield.
rename flag_use_wand to flag_use_range. rename flag_ready_wand to
flag_ready_range. Add flag_ready_scroll. Update ARMOUR_SPELLS access
macro. Add AP_PRINT flag to apply flags. Add CAN_APPLY_.. return types
for can_apply_object function.
include/includes.h: add strftime, mktime checks to this file.
include/libproto.h: rebuilt.
include/living.h: Add NUM_STATS define, update extern declarations
to use it for sizing.
include/loader.h: remove the V_.. info and xbm_.. externs that were not
used.
include/newserver.h: Remove ext_tile information.
include/object.h: Add Body_Locations structure, NUM_BODY_LOCATIONS define.
Add definitions for WILL_APPLY values. Clean up object structure -
formatting is now consistent, ordering of values groups values
together more logically. Update all types to use the int8/int16/int32
types. Several unused fields removed.
include/player.h: Update rangetype enum. Add unapplymode enum.
Clean up player structure - type updates, unused fields removed,
formatting fixed up.
include/spells.h: remove range_name extern. Update SpellTypeFrom
field to combine wand/rod/horn into spellMisc - none of the
spell casting code was differentiating these.
include/sproto.h: rebuilt.
lib/Makefile.in: Add new help files (applymode, bind, brace)
lib/archetypes: rebuilt for body_info, gen_sp_armour, item_power,
can_use_shield information.
lib/artifacts: updated for item_poer and gen_sp_armour changes.
lib/treasures: remove unused _force for player treasure.
plugin/plugin_python.c: Change FLAG_USE_WAND to FLAG_USE_RANGE.
server/apply.c: Move stftime, mktime to include/includes.h. Remove
draw_find() - one line function can just as easly be in the
code itself. Update calls to long_desc to pass second parameter.
move gravestone_text() to player.c file. Add direction parameter to
apply_scroll() - in this way monsters can use it properly.
Remove dead code. Update apply_special function. Add
unapply_special(), get_item_from_body_location(), unapply_for_ob(),
and can_apply_object() functions.
server/attack.c: Remove SET_FLAG(op, FLAG_PARALYZED) line - no code
was ever checking status of FLAG_PARALYZED.
server/c_misc.c: add command_body() which dumps body information for
player. Update who as idle element in player structure removed -
was not being used by anything. Add command_applymode() to
set players prefered unapply method. Remove calls to unlock_player()
in various functions - unlock_player() has not done anything
meaningful for a while.
server/c_object.c: Modify long_desc to take a second parameter
which is who is examing the object. this is needed so that we
can pass it down to some of the lower level functions.
Update calls to describe_item to pass this second parameter.
remove FLAG_NO_PRETEXT code - no archetyps were using it. When
examining objects, also tell player where to put them on.
server/c_range.c: Update legal_range() - we now store the object that
is responsible for a range in the player object, so code is
much simpler. Update change_spell() to not destroy golem
just by readying another spell - we now let players regain control
of golems after switching to another range. Update change_spell
to use item name of object for range description.
server/c_wiz.c: remove reference to count_left from player object -
field removed from structure.
server/commands.c: add new commands (applymode, body) to command dispatch
table.
server/login.c: Remove unlock_player() and lock_player() and calls to it -
current checking of names at login should be sufficient to
prevent duplicates. Remove dead code from check_name. Update
load/save code for unapply mode value. Add set_flag(op,
FLAG_USE_SHIELD) if player is allowed to use armor - needed since
flag_use_shield is really a class feature and so is not automatically
updated for old player files.
server/main.c: Remove references to count_left. memset marker object to
NULL - seems to increase stability on metalforge server.
server/monster.c: Many updates related to the body info - monsters follow some
rules as players. Add monster_should_cast_spell function - monsters will
use this for all spellcasting related actions (abilities, scrolls, wands,
etc). Update for merged rod/horn/wand ranges. Update bow use by monsters
- they don't actually need to equip it to fire - this way we don't need to
constantly swap the monsters weapons between the bow and melee item. Use
fire_bow from player.c for most of the work. Modify scroll usage -
monster will use it when player is near, not when it first picks it up.
Add FLAG_READY_SCROLL to denote the monster has a scroll to use. Also,
monster now casts it in appropriate direciton. Merge the
monster_use_wand/rod/horn into monster_use_range. Modify
check_good_weapon and check_good_armour to just look at the stats of the
two items without needing the monster to apply it first.
server/player.c: Print motd in green so it is more noticable. Update
get_player function to do work it did before as well as that of
get_player_ob. Have get_player take a parameter which is the object of
the player if he has one. Modify to use memset to clear the player
structure - more sure fire than explicitly listing values to initialize.
Remove calls to unlock_player. Modify fire_bow so that monsters can also
use the function. Add fire_misc_object() to fire_wand/rod/horn - removes
code from fire(). Add gravesetone_text() to this file.
server/shop.c: Update to pass second parameter to describe_item().
server/skill_util.c: Update check_skill_to_fire since there are fewer
rangetypes now. change range_scroll name to range_golem, as that is
a bit more accurate for what it actually does. Modify show_skills()
to show player his item power and total of items he has equipped.
server/skills.c: Add second paramater to long_desc, remove references to
count_left.
server/spell_effect.c: Add second paramater to long_desc, remove references to
count_left. Update range_scroll to range_golem
server/spell_util.c: remove references to count_left. Update messages
if player trying to cast where he can't with new range names.
socket/info.c: Update range information and how we display what it is -
we will use the object name of the range if available. Remove
reference last_known_spell, last_shoot, last_spell, last_value
player structure fields.
socket/init.c: Remove ext_title information.
socket/request.c: Add element for life_stealing in the resistance array.
Remove references to idle, count_left in player structure. remove
ext2 title information.
MSW 2002-07-14
-- End body commit notes --
Show difference between Revision 1.23 and 1.24
Revision 1.23mwedel 2002/06/18 23:33:25 +24 -1
common/item.c, include/material.h: Move the declaration/initialization
of materialtype from material.h to item.c
server/main.c: Modify crypt_string so that on Freebsd systems, it will
use des_crypt if available, if not, won't encrypt.
MSW 2002-06-19
Show difference between Revision 1.22 and 1.23
Revision 1.22mwedel 2002/06/15 00:35:02 +374 -292
common/item.c: break out monster description into describe_monster
function from describe_item - the later was a really long function.
Reveal weapon speed for identified weapons, spell point regen
penalty and max speed for identified armor - this was discussed about
6 weeks ago. Clean up the code to reduce the number of redundant
if statements and otherwise confusing code in describe_item.
MSW 2002-06-14
Show difference between Revision 1.21 and 1.22
Revision 1.21mwedel 2002/05/30 23:18:32 +10 -78
Main change is the addition of name_pl and client_type to object
structure. The name_pl contains the proper plural name instance - fixes
problem of '2 tooths'. client_type is sent to the client so that client
doesn't need to figure out sorting on its own. Client_type is an object
attribute, so can be modified in maps to hide the real type.
--
common/arch.c: item_matched_string() modified to use the name_pl field
when trying to match names, and not to try to make the name plural
itself.
common/item.c: query_short_name(),query_base_name() modified to
use name_pl instead of trying to make the name plural.
common/loader.c, common/loader.l: Add code to load and save the name_pl
value and client_type. Add logic when object is finished loading
to set name_pl value to same as name or arch name if no name_pl
is specified - this supports old maps/characters in which the objects
dont have a name_pl field yet. Disable logic for need_an and need_ie
flags since they are no longer needed. Fix bug that caused
elevation not to get saved.
common/object.c: Add client_type check for CAN_MERGE function. Add
appropriate logice in functions to handle setting, clearing, and
copying of name_pl values. Remove unused anim_... fields
initialization.
doc/Developers/objects: Add information about the name_pl field and
client_type.
doc/Developers/protocol: Remove item protocol command info - it has
been obsoleted. Add information about item2 protocol command.
include/define.h: Remote ST1_* values - they were not being used.
comment out FLAG_AN and FLAG_NEED_IE values.
include/newserver.h: Add itemcmd to socket structure - this is the
version of the item protocol command that will be sent to the client.
include/object.h: Add name_pl and client_type field to object structure.
Remove unused anim_* values.
lib/archetypes: rebuilt with new archetypes that contain client_type
and name_pl information.
lib/bmaps, lib/bmaps.paths, lib/crossfire.1, lib/crossfire.0, lib/faces:
rebuilt.
server/monster.c: Remove anim_ references that were not being used.
socket/init.c: Initialize itemcmd version in the socket to 1.
socket/item.c: Remove special handling for clients of old versions - all
clients now have to be at least sc_version 1024 (which has been around for
a long time). This simplifies a lot of the object code that deals with
sending or not sending plural names to the client - now always send them.
Change code that sends item to client to use the item revision (currently
1 or 2) that the client wants. If version 2, send along client_type
information.
socket/request.c: Handle 'itemcmd' parameter in setup command. Make
sure it is in proper range. If client is very old (sc_version < 1024)
tell them so.
MSW 2002-05-30
Show difference between Revision 1.20 and 1.21
Revision 1.20avogl 2002/03/03 14:05:57 +2 -2
two fixes to my dragon-race code:

- fixed stringcompares wich caused crashed
with players that have race NULL.
- forgot to commit "server/init.c" before,
which resulted in function dragon_ability_gain()
not to get bound, thus missing dragon ability gains.
Show difference between Revision 1.19 and 1.20
Revision 1.19avogl 2002/03/01 15:33:09 +31 -7
As announced on cf-devel, this is the patch which
adds a new dragon-race to Crossfire.
Players of this dragon race can gain resistances
by eating the flesh of their defeated foes.

They can also specify in a certain resistance-type
and gain various abilities when increasing levels.
This "focus" can be switched by eating very special
As announced on cf-devel, this is the patch which
adds a new dragon-race to Crossfire.
Players of this dragon race can gain resistances
by eating the flesh of their defeated foes.

They can also specify in a certain resistance-type
and gain various abilities when increasing levels.
This "focus" can be switched by eating very special
flesh, which will be available for sale.
Dragon players gain special titles which cannot
be overwritten by manually set titles.

Also see the dragon race description during the
race selection process.
Note that the quetzal has been slightly modified
(picture and race) to prevent getting mixed up with
the new dragon race.

Please keep in mind that this is the first version
of this dragon-race-code. Do not expect it to be
perfectly balanced in all aspects.
Player's opinions will provide some good feedback
for further development I hope.

--AndreasV
Show difference between Revision 1.18 and 1.19
Revision 1.18mwedel 2001/07/13 23:04:53 +3 -2
common/Makefile.in: Remove ltostr.c and sqrt.c from list of files
common/ltostr.c, common/sqrt.c: Moved into porting.c
common/anim.c, common/button.c, common/item.c: Update calls to update_object
common/living.c: have fix_player calculate light value for player/monster.
common/logger.c: Remove code that has server exit if too many LOG messages
happen too quickly. This was not a reliable mechanism, and it should
really be up to the functions doing the logging to know if they can
continue or not.
common/los.c: Changes on how it deals with lighting on maps - get light
value from map space array instead of using the linked list. Functions
that managed the light list have been removed. Change logic of
line of sight function to be more efficient (before, we may examine
the same space multiple times). rename update_all_los to
update_all_map_los, and change update_all_los to take coordinates
so that we only have clients within view of the change recalculate
los. Also, have update_all_los check for tiled maps that may have
clients that need to get updated.
common/map.c: remove refresh_map - this used to be used to try to recover
from map errors if many_cores was not set - IMO better to core and
just restart and really fix the error than try to deal with possible
corruption that may otherwise result.
Move open_and_uncompress and close_and_delete functions to porting.c -
they are 'common' functions that are not related to the map code.
Remove some lighting related code, as that is no longer done with
a list. Many modifications because of new map structure. And
logic to load and save the new map structure format. Modify
many of the functions to take map tiling into account. Change
way multipart objects are saved, and add logic to relink objects
when maps are loaded up. Remove some functions that are only
used by the editor into the editor. Move update_position from
object.c to map.c as it is better placed in map.c. Modify
function to figure out light for a space. Make out_of_map a
function that knows about map tiling. New function - get_map_from_coord
which knows about map tiling and does coordinate and map translation.
common/object.c: Have update_object take another parameter which tells
update object what has changed about the object. This lets the function
know if it should call update_position right away or if it can just
mark the space as needing an update at a later time. move update_position
to map.c.
insert_ob_in_map: now takes another parameter that describes actions not
to do. modified to know about map tiling and do appropriate translation.
Does some object sorting so it should handle spell objects more
efficiently.
insert_ob_in_map_simple is now replaced by
using appropriate flag to this changed version of insert_ob_in_map.
Clean up remove_ob - seemed to have done things in a more complicated
fashion that is no longer necessary. Modify check_walk_on to look
at all objects on space, not those below the object - with changes to
insert_ob_in_map, new object won't always be on top.
common/porting.c: functions from ltostr.c, sqrt.c, as open_and_uncompress
close_and_delete, make_path_to_file from map.c
common/treasure.c: Modified to use updated insert_ob_in_map
MSW 2001-07-13
Show difference between Revision 1.17 and 1.18
Revision 1.17mwedel 2001/06/11 23:29:44 +3 -3
common/item.c: Add boots and gloves to items which are not magical just
because they have resist physical. This bug resulted in most all boots
and gloves being shown as magical, even though they had no special
properties.
socket/request.c: remove some dead code. Memset entire map cell
to zero when scrolling and the map is cells is one that was not in
view. This fixes redraw problems when using large viewable maps.
MSW 2001-06-11
Show difference between Revision 1.16 and 1.17
Revision 1.16mardahl 2001/04/20 20:22:43 +2 -2
Make the faces of potions look better. Required commenting out
some code is all.
Show difference between Revision 1.15 and 1.16
Revision 1.15mwedel 2001/04/04 01:52:31 +2 -1
common/item.c: Modify identify function to clear the NO_SKILL_IDENT
flag so objects will now merge. Also, once the object has been
identified, the no_skill_ident doesn't have meaning anymore.
MSW 2001-04-03
Show difference between Revision 1.14 and 1.15
Revision 1.14cvs 2001/02/02 23:30:17 +11 -2
MSW 2001/02/02:
common/item.c: Don't have armour item types get returned as magical if they
have an armour value - that is to be expected. This eliminates the false
positives that you otherwise get on armor when you cast detect magic.
include/newserver/h: and checksum field to FaceInfo struct. Update
version_sc to 1026.
socket/init.c: calculate image checksums as we load the images.
socket/request.c: If client is at least version_Sc 1026, use face1 protocol
command that includes the checksum.
Show difference between Revision 1.13 and 1.14
Revision 1.13cvs 2000/12/03 18:40:03 +40 -40
Checking for partial resistance code. Various minor errors also fixed
(compiler warnings, unused variables, Makefile.in changes, etc).
PR code also includes support to send protections to the client.
Show difference between Revision 1.12 and 1.13
Revision 1.12peterm 2000/11/26 01:20:11 +10 -10
"hunger -1" message changed to "sustenance -1"
Show difference between Revision 1.11 and 1.12
Revision 1.11cvs 2000/11/08 01:19:37 +14 -13
MSW 2000-11-07
common/item.c: query_base_name was not return plural version of items
with 'of' in name. Also, much of the function was not using safe_strcat,
which could result in buffer overlow problems.

common/object.c: Change update_position so that we always generate
3 images per space. This fixes players standing on top of dragon transports,
but generally works for things like monsters standing on objects.
insert_ob_in_map: change 'return' statement to 'return NULL'. Also
remove unused map pointer.
decrease_ob_nr: Fix bug for client updates when player drops item that
is then consume. It was using op->above after object was removed to
find the player. Store above pointer before we remove the object.

socket/item.c: Don't terminate pointer as returned by query_base_name -
instead, terminator buffer after we copy it. For simple object,
query_base_name may directly return a pointer to the objects name
which is only long enough to hold the name itself.

socket/lowlevel.c: Abort if we are trying to send the client a packet
longer than supported by the protocol. Since that buffer is static,
overflowing it will just create memory corruption - easier to stop
then than try and debug it later.

End of MSW checkin 2000-11-7
Show difference between Revision 1.10 and 1.11
Revision 1.10peterm 2000/10/18 15:00:39 +29 -3
Map.c was NOT changed.
item.c was changed to use op->slaying for spellbooks.
Show difference between Revision 1.9 and 1.10
Revision 1.9cvs 2000/08/07 00:16:34 +42 -3
The following change basically does the following: When the server sends an
item name to the client, this item name is now two pieces - the first piece
of the name is its singular form, the second piece is the plural name. This
now makes items in the inventory appear more proper in terms of pluralization
and just normal English. I did notice that the server does not know how
to properly make 'torch' plural - it turns it into torchs. A matching
check in for the client has also been done.
include/newserver.h: Update VERSION_SC to 1024
common/item.c: Change query_base_name to take a second option on whether
we should generate a plural version of the name or not.
socket/item.c: Modify functions to use second argument on the query_base_name
function. Update item commands to send two part names (singular & plural).
Modify esrv_send_look to use item1 protocol command instead of item command.
server/c_object.c: Update item_matched_string to use second option to
query_base_name. Modify function to check against both singular and
plural versions of name.
server/shop.c: Modify shop_listing command usage in query_basename to use
second option. It will also generate the singular name, but that is only
used on sorting, so I don't think it will generally cause any problems.
include/libproto.h: rebuilt because query_base_name has an addition opt.
Mark Wedel 8/13/2000
Show difference between Revision 1.8 and 1.9
Revision 1.8cvs 2000/05/27 02:08:12 +5 -2
common/item.c: Fix query_short_name - wasn't generating all item names
properly because of changes made a few days ago - some areas manipulate
the string being worked on and was not updating the length properly.
Show difference between Revision 1.7 and 1.8
Revision 1.7cvs 2000/05/27 01:02:58 +2 -3
include/define.h: Add MIN_ACTIVE_SPEED value to determine what threshold
something will be put on the active list or not instead of using
varying values throughout the source code.
common/item.c, common/object.c, server/monster.c, server/pets.c,
server/spell_effect.c: Updated to use the MIN_ACTIVE_SPEED instead of
hardcoded values. MSW 5/26/2000
Show difference between Revision 1.6 and 1.7
Revision 1.6cvs 2000/05/23 02:06:32 +46 -44
include/define.h: add safe_strcat inline/static function. Add
DESCRIBE_ABILITY_SAFE and DESCRIBE_PATH_SAFE which use the safe_strcat
to prevent buffer overuns.
common/item.c: Have query_name use HUGE_BUF for its buffer - query_short_name
uses that buffer size, and we call the same thing. have quer_name and
query_short_name use the safe_strcat function. Increase buffer size
in ring_desc to be a VERY_BIG_BUF and also use safe_strcat along with the
DESCRIBE_*_SAFE macros.
server/input.c: Modify examine.c to not get buffer overruns for very long/
complicated items. Modify long_desc to also handle long names/descriptions
without buffer overruns.
socket/item.c: Modify the functions that prepend the length to the name
of the object to handle very long (>255) object names properly - now we
just truncate it and only send the first 255 bytes. add function
add_stringlen_to_sockbuf to make this task easier.
With the above changes, very long named items/items with very long
descriptions works properly in both the server (no crashes) and the
client (no crashes/protocol errors) MSW 5/22/2000
Show difference between Revision 1.5 and 1.6
Revision 1.5cvs 2000/05/22 22:52:21 +7 -5
common/item.c: Modify query_short_name to avoid buffer overflow on long
ring descriptions. Also, increased size of buffer in this function so
that longer ring descriptions will not get truncated. MSW 5/22/2000

server/c_chat.c: Add standard banner to top of file. Fix say command so
that it does not crash the server if something beyond 256 characters is
spoken - extra data is just truncated. MSW 5/22/2000
Show difference between Revision 1.4 and 1.5
Revision 1.4damn 1999/09/17 18:36:56 +2 -2
Oops... typo: VERY_BIG__BUF
Show difference between Revision 1.3 and 1.4
Revision 1.3damn 1999/09/17 18:33:43 +2 -17
DESCRIBE_ABILITY macro moved to defines.h -- DAMN
Show difference between Revision 1.2 and 1.3
Revision 1.2cvs 1999/07/13 01:02:41 +0 -0

Global commit for 0.95.4 - most files have no changes but just have
differing headers between my local RCS and the CVS versions and need to
get synced up.
Show difference between Revision 1.1 and 1.2
Revision 1.1uid200 1999/04/02 13:10:03 None
Initial revision
First version
Revision 1.1.1.1uid200 1999/04/02 13:10:03 +0 -0
First CVS revsion: crossfire-0.95.3
Show difference between Revision 1.1 and 1.1.1.1


File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:08