From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22436 invoked by alias); 5 Jul 2004 20:27:09 -0000 Mailing-List: contact xconq7-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: xconq7-owner@sources.redhat.com Received: (qmail 22428 invoked from network); 5 Jul 2004 20:27:08 -0000 Received: from unknown (HELO iron.cat.pdx.edu) (131.252.208.92) by sourceware.org with SMTP; 5 Jul 2004 20:27:08 -0000 Received: from jess.cs.pdx.edu (jess.cs.pdx.edu [131.252.209.199]) by iron.cat.pdx.edu (8.12.10/8.12.10) with ESMTP id i65KQuYr001004 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 5 Jul 2004 13:27:02 -0700 (PDT) Received: from jess.cs.pdx.edu (localhost.localdomain [127.0.0.1]) by jess.cs.pdx.edu (8.12.10/8.12.10) with ESMTP id i65KQuQs030270 for ; Mon, 5 Jul 2004 13:26:56 -0700 Received: from localhost (cwood@localhost) by jess.cs.pdx.edu (8.12.10/8.12.10/Submit) with ESMTP id i65KQubE030266 for ; Mon, 5 Jul 2004 13:26:56 -0700 Date: Mon, 05 Jul 2004 20:44:00 -0000 From: Christopher Wood To: xconq7@sources.redhat.com Subject: Question on combat procedures In-Reply-To: Message-ID: References: <17030786.1088898907645.JavaMail.root@skeeter.psp.pas.earthlink.net> <40E749CD.9000905@phy.cmich.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new X-SW-Source: 2004/txt/msg00660.txt.bz2 Hi all, I am trying to figure out how these combat module works in the xconq source code. I have looked over combat.c and I have seen how it switches depending on the model through the g_combat_model call. However what I would like is to know what is calling the functions in combat and how the order is being done. The combat.c file is quite confusing and I can't quite figure out how it works together with the rest of the program since I have no idea where these functions are being called from. The only place I could find something that even fits that is action.def where it seemed it went according to the following list. DEF_ACTION("attack", ACTION_ATTACK, "Un", prep_attack_action, net_prep_attack_action, do_attack_action, check_attack_action, (Unit *unit, Unit *unit2, Unit *defender, int n), "Attack a given unit") DEF_ACTION("overrun", ACTION_OVERRUN, "xyzn", prep_overrun_action, net_prep_overrun_action, do_overrun_action, check_overrun_action, (Unit *unit, Unit *unit2, int x, int y, int z, int n), "Attack everything in a cell and occupy if possible") DEF_ACTION("fire-at", ACTION_FIRE_AT, "Um", prep_fire_at_action, net_prep_fire_at_action, do_fire_at_action, check_fire_at_action, (Unit *unit, Unit *unit2, Unit *defender, int m), "Throw a given material at a given unit") DEF_ACTION("fire-into", ACTION_FIRE_INTO, "xyzm", prep_fire_into_action, net_prep_fire_into_action, do_fire_into_action, check_fire_into_action, (Unit *unit, Unit *unit2, int x, int y, int z, int m), "Throw a given material at a given cell") DEF_ACTION("capture", ACTION_CAPTURE, "U", prep_capture_action, net_prep_capture_action, do_capture_action, check_capture_action, (Unit *unit, Unit *unit2, Unit *defender), "Take a unit prisoner") DEF_ACTION("detonate", ACTION_DETONATE, "xyz", prep_detonate_action, net_prep_detonate_action, do_detonate_action, check_detonate_action, (Unit *unit, Unit *unit2, int x, int y, int z), "Damage or destroy self in a violent fashion") This seems to be saying that any action is broken into a series of four calls, a prep, a net_prep (I take it this has to do with network protocals), a do and a check. So if I wanted to change things around I would change the function calls in this list? Also when two units are next to eachother and one targets another, how does the engine determine which of the overrun, attack, fire at, etc lists gets called? So here broken down are my questions. 1) Is the above lists in action.def the series of functions that get called for a particular attack? 2) Would it be possible to switch the do_ action for one of my own that would implement the tactical combat engine? 3) This question is mainly for Elijah. Were you able to get the castironlife extension to implement the tactical engine you have on the site for your game? Thanks, Chris Wood