From: Hans Ronne <hronne@telia.com>
To: Elijah Meeks <elijahmeeks@yahoo.com>
Cc: xconq7@sources.redhat.com
Subject: Re: Occupant Protection
Date: Wed, 04 Jun 2003 17:13:00 -0000 [thread overview]
Message-ID: <l03130300bb03d4c78424@[212.181.162.155]> (raw)
In-Reply-To: <20030604020307.30093.qmail@web13108.mail.yahoo.com>
>I've rewritten CIL to use combat model 0:
>
>http://castironlife.sourceforge.net/xcil-new.zip
>
>And, though it seems to work mostly like it should,
>I've found that when occupants protect against an
>attack, they all seem to protect. The result is that
>a single division ends up attacking every division in
>an opposing army. I've got cell protection and
>occupant protection set up, so maybe I'm overdoing it?
> Any ideas on how to rectify this?
This is how things should work. If you think the total protection of the
army is to high, just reduce the amount of protection per occupant/divison.
Hans
P.S. The occupant protection, stack protection and cell protection code
have quite different roles. See this commented piece of combat code:
/* Account for protection by occupants. */
for_all_occupants(other, occ) {
if (in_play(occ) && completed(occ)) {
prot = uu_protection(occ->type, o);
if (prot != 100)
chance = (chance * prot) / 100;
}
}
/* Account for protection by neighbours. */
for_all_stack(other->x, other->y, unit2) {
if (unit2 != other
&& in_play(unit2)
&& completed(unit2)
&& unit2->side == other->side) {
prot = uu_stack_protection(unit2->type, o);
if (prot != 100)
chance = (chance * prot) / 100;
}
}
/* Note that this code differs from that above in that it treats
all units in the same cell equally, whether occs, suboccs or
cellmates. This also means that one occ can protect another occ
in the same transport. Moreover, the protective unit also
protects itself. These rules simulate real situations such as
when triple-A protects all nearby units (including itself)
against bombers, or when a city wall protects all other
occupants against ground attack. */
for_all_stack_with_occs(other->x, other->y, unit2) {
if (is_active(unit2)
/* We also extend protection to our buddies! */
&& trusted_side(unit2->side, other->side)) {
/* This is when a unit, such as triple-A, extends unique
protection against a specific attacker, such as
bombers, to all other units in the cell. */
prot = uu_cellwide_protection_against(unit2->type, a);
if (prot != 100)
chance = (chance * prot) / 100;
/* This is when a unit (such as a garrison) specifically
protects a second unit, such as a fort (but not other
nearby units), against all forms of attack. It thus
works the same way as uu_protection and
uu_stack_protection. */
prot = uu_cellwide_protection_for(unit2->type, o);
if (prot != 100)
chance = (chance * prot) / 100;
}
}
next prev parent reply other threads:[~2003-06-04 17:06 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-22 23:58 Problem With Unit Fire Elijah Meeks
2003-05-23 0:39 ` Hans Ronne
2003-05-23 4:35 ` Elijah Meeks
2003-05-23 19:11 ` Hans Ronne
2003-06-10 3:57 ` Advanced Unit Damage Elijah Meeks
2003-06-10 14:13 ` Hans Ronne
2003-06-10 17:08 ` Downloading Xconq Elijah Meeks
2003-06-02 22:19 ` Getting the Treasury to Work and Other Issues Elijah Meeks
2003-06-03 22:57 ` Hans Ronne
2003-06-04 2:03 ` Doctrine, Plans, Tasks, Standing Orders Elijah Meeks
2003-06-04 17:28 ` Hans Ronne
2003-06-05 2:09 ` Jim Kingdon
2003-06-05 17:07 ` Setting Advanced Unit Size Elijah Meeks
2003-06-05 20:13 ` Hans Ronne
2003-06-08 6:37 ` Supply and AI Elijah Meeks
2003-06-08 9:00 ` Jim Kingdon
2003-06-10 16:11 ` website update Erik Jessen
2003-06-08 16:26 ` Supply and AI Hans Ronne
2003-06-08 18:44 ` Elijah Meeks
2003-06-08 20:01 ` Hans Ronne
2003-06-10 1:51 ` Elijah Meeks
2003-06-28 18:08 ` New Game Elijah Meeks
2003-06-28 23:20 ` Hans Ronne
2003-06-04 17:06 ` Occupant Protection Elijah Meeks
2003-06-04 17:13 ` Hans Ronne [this message]
2003-06-24 20:27 ` A Couple Questions Elijah Meeks
2003-06-24 20:43 ` Hans Ronne
2003-06-24 20:54 ` Elijah Meeks
2003-06-25 21:48 ` Hans Ronne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='l03130300bb03d4c78424@[212.181.162.155]' \
--to=hronne@telia.com \
--cc=elijahmeeks@yahoo.com \
--cc=xconq7@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).