Protocol: | pserver | User: | anonymous |
Machine: | crossfire.cvs.sourceforge.net | CVSROOT: | /cvsroot/crossfire |
Filename: objects | |||
Revision 1.22 | akirschbaum | 2006/09/12 11:58:14 | +1 -1 |
Fix typo. | |||
Show difference between Revision 1.21 and 1.22 | |||
Revision 1.21 | ryo_saeba | 2006/08/19 15:47:39 | +1 -1 |
Update. | |||
Show difference between Revision 1.20 and 1.21 | |||
Revision 1.20 | mwedel | 2006/02/07 01:54:45 | +25 -21 |
Code that adds transports. Transports are described more in detail in docs/Developers/objects. --- loader.l: Add new move type ('boat'). Update move_name field to be aware of this type. common/object.c: Unrelated to transport, but more apparant with transports - fix bug with insert_ob_in_map() and multipart objects - we now only try to fix up map and coordinates if the provided coordinates are out of the map. Before, function would always use the passed map for multipart objects, which is incorrect if we have already set valid coordinates. doc/Developers/objects: Update notes for TRANSPORTS. Update move information to include MOVE_BOAT. include/define.h: Add type TRANSPORT. Add MOVE_BOAT. include/player.h: Add transport field to player structure. include/sproto.h: rebuilt. server/apply.c: Add code to handle applying of transports. Update apply_below to apply transport if player is on one. server/attack.c: Update hit_map() to look for transports, and hit any players with the damage. server/c_object.c: Update put_object_in_sack() to also handle TRANSPORTS so that code can be re-used. server/move.c: Fix handling of multipart objects in move_object() - old code didn't work right with multipart objects moving along seams of tiled maps. Add code to move_ob() to update player map position for all players in a moving transport. server/player.c: Update move_player_attack() too check of player is in tranport, and use that for map and location information. Update move_player() to handle speed related issues with transports. server/time.c: Add code to credit time back to TRANSPORT objects since we remove time in move_player() for TRANSPORTS. socket/item.c: Add add_object_to_socklist() so that same code isn't reproduced in 3 different places in the file. Update draw_look() to handle transports - send transport object itself, then objects in transport. Update esrv_send_inventory() and esrv_send_item() to use add_object_to_socklist(). Update esrv_get_ob_from_count() to look for objects in transport if player is in transport. socket/loop.c: Remove checking of pl->map status, since draw_client_map() does that, and we need to handle if the player is in a transport. socket/request.c: Handle map drawing if player is in a transport. MSW 2006-02-06 | |||
Show difference between Revision 1.19 and 1.20 | |||
Revision 1.19 | mwedel | 2006/02/04 23:27:08 | +133 -1 |
movement type changes. Add move_allow field to explicitly allow certain movement types on spaces. Add suppport for using string names instead of numeric values to specify the MOVE_ values. Add code so when saving data out, use string names instead of numeric value. --- common/loader.l: Remove save_double(), as it isn't used by any code. Add set_move() to set movement types from strings. Add get_string_move_type, which takes integer movement type and returns a string. Update load and save code to use these functions respectively. common/map.c: Change blocked_link() so that we only examine all the objects on a space if there is something alive on the space or space is otherwise blocked. There is no reason to examine all the objects on the space if the object in question can move onto it. Modify update_position() to use the move_allow field to clear bits in the move_block field. common/object.c: Add check in CAN_MERGE for move_allow. Add check for move_allow in update_object to see if we should update the space or not. doc/Developers/objects: Update Movement code section to note use of using strings to set movement types. Add note about move_allow. Section about Transports added, but code isn't there yet. include/object.h: Add move_allow to object structure. MSW 2006-02-04 | |||
Show difference between Revision 1.18 and 1.19 | |||
Revision 1.18 | mwedel | 2005/11/16 02:16:00 | +35 -2 |
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.17 and 1.18 | |||
Revision 1.17 | qal21 | 2005/09/15 20:02:06 | +51 -14 |
Allow directors/movers to specify a specific arch/name/race. | |||
Show difference between Revision 1.16 and 1.17 | |||
Revision 1.16 | mwedel | 2005/09/13 01:46:36 | +74 -3 |
This change is mostly cosmetic and a preparation for the new movement type code. Basically, it just changes the old object movement_type field to attack_movement. This makes sense because that is what that field is called in saved and loaded objects/archetypes, and thus frees up that name for the new movement code. -- common/button.c: field name change common/loader.{cl}: field name change doc/Developers/objects: Add section on new movement types, update old documentation to note it is attack_movement and not movement_type field that is important. include/object.h: field name change. server/attack.c: field name change. server/monster.c: field name change server/pets.c: field name change server/skills.c: field name change. server/spell_attack.c: field name change server/spell_effect.c: field name change MSW 2005-09-12 | |||
Show difference between Revision 1.15 and 1.16 | |||
Revision 1.15 | mwedel | 2005/08/17 01:58:11 | +13 -2 |
Add patch by Kevin Rudat for applyable but non pickable objects to have item items. doc/Dvelopers/objects: Update item types. socket/item.c: Use the head of any objects we send. Should generally only be an issue for objects on the ground, as currently there is no large objects players can pick up. Also fix up some of the formatting/ indenting in this file. MSW 2005-08-16 | |||
Show difference between Revision 1.14 and 1.15 | |||
Revision 1.14 | cavesomething | 2005/08/16 15:31:42 | +1 -0 |
Add flag to lamps to make them able to be lit without needing negative light radii | |||
Show difference between Revision 1.13 and 1.14 | |||
Revision 1.13 | ryo_saeba | 2005/07/21 16:30:20 | +11 -1 |
Small updates, points to quests document. | |||
Show difference between Revision 1.12 and 1.13 | |||
Revision 1.12 | ryo_saeba | 2005/07/21 16:18:05 | +1 -0 |
Add item transformer client type. | |||
Show difference between Revision 1.11 and 1.12 | |||
Revision 1.11 | mwedel | 2004/05/14 00:47:30 | +29 -1 |
Add notes about duplicators. MSW 2004-05-13 | |||
Show difference between Revision 1.10 and 1.11 | |||
Revision 1.10 | mwedel | 2003/09/13 00:01:31 | +8 -4 |
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.9 and 1.10 | |||
Revision 1.9 | tchize | 2003/09/03 07:25:06 | +10 -3 |
generator may now use their inventory as a basis to generated items instead of the other_arch field. Will allow more fine tuned generators | |||
Show difference between Revision 1.8 and 1.9 | |||
Revision 1.8 | mwedel | 2003/04/04 23:39:48 | +46 -4 |
acinclude.m4: Update path to find python includes, since aclocal.m4 gets derived from this file. configure.ac, configure: Add utils/scores.pl to list of files to substitute on. common/loader.l, loader.c: Add subtype for objects - will be used in future work. common/object.c: Add subtype diff check in CAN_MERGE() common/porting.c: Have it use SAVE_DIR_MODE when doing the mkdir, and not have hardcoded 777 permissions. doc/Makefile.in, doc/Makefile.am, doc/Developers/Makefile.am, doc/Developers/Makefile.in: Move some of the spell docs around and merge them together doc/Developers/objects: Add notes about subtype. doc/Developers/spells: New file, contains preliminary work on spell objects. include/config.h: Remove command about DM_MAIL and LIBDIR from file, as they are options no longer present. Update comment about SAVE_MODE, and add SAVE_DIR_MODE include/object.h: Add subtype field to object. server/login.c: Have it use SAVE_DIR_MODE when doing the mkdir, and not have hardcoded 6700 permissions. utils/Makefile.in: Updated to know about scores.pl utils/scores.pl.in: New file - reads player file to generate HTML score file. MSW 2003-04-04 | |||
Show difference between Revision 1.7 and 1.8 | |||
Revision 1.7 | mwedel | 2003/02/12 00:30:26 | +16 -0 |
Add lore/endlore to object structure to hold general information about objects: common/loader.c, common/loader.l: Add loading and saving of lore field. common/object.c: handle lore field for copy/free/other object operations. Also, update CAN_MERGE to look at materialname also. doc/Developers/objects: Add notes about lore. include/object.h: add lore field to object. MSW 2003-02-11 | |||
Show difference between Revision 1.6 and 1.7 | |||
Revision 1.6 | mwedel | 2003/02/10 00:52:11 | +37 -0 |
doc/Developers/objects: Add nodes about shared strings in objects. server/c_misc.c: Remove check for name length - check_name takes care of that for us. server/monster.c: store return value from get_map_flags - seen some crashes traced back to this area, want to see what it returned. Allow objects with no msg to still use scripts that listen. server/player.c: Fix potentional issue of freeing/adding players name when they enter play again - seen some crashes attributed to odd names. MSW 2003-02-08 | |||
Show difference between Revision 1.5 and 1.6 | |||
Revision 1.5 | mwedel | 2002/09/18 01:17:20 | +30 -0 |
Various updates: NOTE - You need to install the updated archetypes (included below) if you run this code without the updated archs, you will likely find many things do not work. acinclude.m4 aclocal.m4 configure: more refinements for libpython detection. common/button.c: Two push_button() changes - have it check for ACTIVATE_ON_ PUSH/RELEASE to determine if the object should get activated. Also, change behaviour of TIMED_GATE so that multipart timed gates work. common/loader.l, loader.c: Update with acttivate_on_push/release doc/Developers/objects: Add notes about how to add flags to objects. include/define.h: add new FLAG_ values include/win32.h: update by pstolarc so it compiles on Win32. lib/archetypes: rebuilt MSW 2002-09-17 | |||
Show difference between Revision 1.4 and 1.5 | |||
Revision 1.4 | mwedel | 2002/08/22 01:49:04 | +668 -379 |
doc/Developers/objects: Update with new (better) information from Todd Mitchell. Doc is more complete, and now has an index which should make it easier to find things. server/move.c: Fix dereferencing NULL problem - was looking at op->above, but op could be NULL if the map had no objects on a space (typically not the case, but...) No reason I can see that we care about the object above - just process in normal order. MSW 2002-08-21 | |||
Show difference between Revision 1.3 and 1.4 | |||
Revision 1.3 | mwedel | 2002/07/14 23:57:12 | +114 -0 |
-- 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.2 and 1.3 | |||
Revision 1.2 | mwedel | 2002/05/30 23:18:33 | +206 -0 |
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.1 and 1.2 | |||
Revision 1.1 | mwedel | 2002/01/14 01:56:02 | None |
Make a seperate 'Developers' subdirectory in doc, and put relevant developer files in that directory. This should hopefully make it a bit easier to find information for both players and developers. MSW 2001-01-14 | |||
First version |