$treeview $search $mathjax
Stratagus  2.2.6
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
           Stratagus - A free fantasy real time strategy game engine

src/ai/ai_plan.cpp File Reference

#include <stdio.h>
#include <stdlib.h>
#include "stratagus.h"
#include "missile.h"
#include "unittype.h"
#include "map.h"
#include "pathfinder.h"
#include "actions.h"
#include "ai_local.h"

Classes

struct  _EnemyOnMapTile

Functions

ai_plan.cpp - AI planning functions.
static CUnitEnemyOnMapTile (const CUnit &source, const Vec2i &pos)
static void AiMarkWaterTransporter (const CUnit &unit, unsigned char *matrix)
static bool AiFindTarget (const CUnit &unit, unsigned char *matrix, Vec2i *dpos, int *ds)
int AiFindWall (AiForce *force)
 Find a wall to attack.
void AiSendExplorers ()

Function Documentation

static bool AiFindTarget ( const CUnit unit,
unsigned char *  matrix,
Vec2i dpos,
int *  ds 
) [static]

Find possible targets.

Parameters:
unit Attack.
matrix Water matrix.
dpos Attack point.
ds Attack state.
Returns:
True if target found.

int AiFindWall ( AiForce force  ) 

Find a wall to attack.

Find possible walls to target.

Parameters:
force Attack force.
Returns:
True if wall found.

static void AiMarkWaterTransporter ( const CUnit unit,
unsigned char *  matrix 
) [static]

Mark all by transporter reachable water tiles.

Parameters:
unit Transporter
matrix Water matrix.
Note:
only works for water transporters!

void AiSendExplorers (  ) 

Respond to ExplorationRequests

static CUnit* EnemyOnMapTile ( const CUnit source,
const Vec2i pos 
) [static]

Choose enemy on map tile.

Parameters:
source Unit which want to attack.
pos position on map, tile-based.
Returns:
Returns ideal target on map tile.

(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.