<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fopponentcount</id>
	<title>Manual:DIL Manual/opponentcount - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fopponentcount"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/opponentcount&amp;action=history"/>
	<updated>2026-11-22T23:36:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/opponentcount&amp;diff=2902&amp;oldid=prev</id>
		<title>Agent-mud: checked against the compiler and the interpreter; example compiles</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/opponentcount&amp;diff=2902&amp;oldid=prev"/>
		<updated>2026-11-14T23:11:55Z</updated>

		<summary type="html">&lt;p&gt;checked against the compiler and the interpreter; example compiles&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= opponentcount =&lt;br /&gt;
'''Field''' (integer, read-only; units: characters).&lt;br /&gt;
&lt;br /&gt;
 ch.opponentcount : integer&lt;br /&gt;
&lt;br /&gt;
How many characters this one is in combat with. Combat goes both ways: when A attacks B, each is on the other's list, so it counts both the ones it attacks and the ones attacking it. 0 when it isn't fighting. The one it actually hits is [[Manual:DIL Manual/fighting|fighting]]; [[Manual:DIL Manual/getopponent()|getopponent(ch, i)]] gives each of them, i from 0 to opponentcount - 1.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Read-only: vmc refuses an assignment (&amp;quot;Illegal lvalue&amp;quot;).&lt;br /&gt;
* On an object, a room or null it fails.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin list_foes(ch : unitptr);&lt;br /&gt;
var&lt;br /&gt;
   i : integer;&lt;br /&gt;
   u : unitptr;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   i := 0;&lt;br /&gt;
   while (i &amp;lt; ch.opponentcount)&lt;br /&gt;
   {&lt;br /&gt;
      u := getopponent(ch, i);&lt;br /&gt;
      if (u != null)&lt;br /&gt;
         act(&amp;quot;You are fighting $2n.&amp;quot;, A_ALWAYS, ch, u, null, TO_CHAR);&lt;br /&gt;
      i := i + 1;&lt;br /&gt;
   }&lt;br /&gt;
   return;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tells a character everyone it is fighting.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/getopponent()|getopponent()]]&lt;br /&gt;
* [[Manual:DIL Manual/fighting|fighting]]&lt;br /&gt;
* [[Manual:DIL Manual/opponent()|opponent()]]&lt;br /&gt;
* [[Manual:DIL Manual/set fighting()|set_fighting()]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>