Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Create Missile -- This won't work
- To:
- Subject: Re: Create Missile -- This won't work
- From: "tuan (t.) doan" <>
- Date: Fri, 28 Oct 1994 23:40:00 -0500
- Cc: crossfire (at) ifi.uio.no
- Sender: "tuan (t.) doan" <>
- X400-Content-Type: P2-1984 (2)
- X400-MTS-Identifier: [/PRMD=BNR/ADMD=TELECOM.CANADA/C=CA/;bcars735.b.024:29.09.94.04.39.52]
- X400-Originator: /dd.id=1627294/g=tuan/i=t/s=doan/@bnr.ca
- X400-Received: by mta bnr.ca in /PRMD=BNR/ADMD=TELECOM.CANADA/C=CA/; Relayed; Sat, 29 Oct 1994 00:40:02 -0400
- X400-Received: by /PRMD=BNR/ADMD=TELECOM.CANADA/C=CA/; Relayed; Sat, 29 Oct 1994 00:39:52 -0400
- X400-Received: by /PRMD=BNR/ADMD=TELECOM.CANADA/C=CA/; Relayed; Thu, 27 Oct 1994 00:40:00 -0400
In message "Re: Create Missile -- This won't work",
'' writes:
>>
>> Hello,
>>
>> I've got _a_ fix for the create missile problem; it's short so I'll
>> included here.
>>
>> spell_effect.c :
>>
>> int cast_create_missile(object *op, int dir, char *stringarg)
>> {
>> int missile_plus=0, missile_nrof;
>> char *missile_name = NULL;
>This variable doesn't need to be added the way I did it, and it's not
>being assigned to find_archetype(missille_name) here anyways -- bad news
>> archetype *at=NULL;
>--------------
>> object *tmp, *missile=NULL, *weap=NULL;
>>
>> for (tmp=op->inv; tmp != NULL; tmp=tmp->below)
>> if (tmp->type == BOW && QUERY_FLAG(tmp, FLAG_APPLIED))
>> weap= tmp;
>>
>> if (weap==NULL) missile_name = "arrow";
>> else missile_name = weap->race;
> ^
> |
> this will either be arrows or crossbow bolts.
> I changed this line to:
> else missile_name = weap->slaying;
>And added a slaying field to bow and crossbow == to arrow & bolt respectively
>This was the only way I could figure out how to do this witht he existing
>variables, and bow's & crossbows of actual slaying would be really nasty :)
Here is one way around not using a new field. This time I tested the
fixes :-)
int cast_create_missile(object *op, int dir, char *stringarg)
{
int missile_plus=0, missile_nrof;
char *missile_name = NULL;
object *tmp, *missile=NULL, *weap=NULL;
for (tmp=op->inv; tmp != NULL; tmp=tmp->below)
if (tmp->type == BOW && QUERY_FLAG(tmp, FLAG_APPLIED))
weap= tmp;
if (weap==NULL) missile_name = "arrow";
else if (!strcmp(weap->race,"crossbow bolts")) missile_name = "bolt";
else if (!strcmp(weap->race,"arrows")) missile_name = "arrow";
else missile_name = "arrow";
if (!stringarg || ((1 + SP_level_strength_adjust(op, SP_CREATE_MISSILE)) -
(3 * missile_plus)) <= 0)
missile_plus = SP_PARAMETERS[SP_CREATE_MISSILE].bdam +
SP_level_dam_adjust(op, SP_CREATE_MISSILE);
else
missile_plus = atoi(stringarg);
if (missile_plus > 4)
missile_plus = 4;
else if (missile_plus < -4)
missile_plus = -4;
missile_nrof = SP_PARAMETERS[SP_CREATE_MISSILE].bdur *
((1 + SP_level_strength_adjust(op, SP_CREATE_MISSILE)) -
(3 * missile_plus));
if (!find_archetype(missile_name)) {
LOG(llevDebug, "Cast create_missile: could not find archtype %s\n", miss
ile_name);
return 0;
}
missile = get_archetype(missile_name);
missile->nrof = missile_nrof;
missile->magic = missile_plus;
SET_FLAG(missile, FLAG_IDENTIFIED);
if (!cast_create_obj(op,missile,dir))
pick_up(op, missile);
return 1;
}
Regards,
__ __/ / / __ / | / Tuan T. Doan
/ / / / / / | / IEC Layer Testing and Advance Technology
/ / / __ / / | / 2201 Lakeside Blvd. P.O. Box 833871
__/ ______/ __/ __/ __/ __/ Richardson, TX 75083-3871
"It's a kind of magic" -Highlander Phone: 6-444-4575/214-684-4575
Internet: Fax: 6-444-3716/214-684-3716