Changed 'an unit' to 'a unit'
This commit is contained in:
parent
25927f45f7
commit
cd09df73a8
31 changed files with 86 additions and 86 deletions
action
ai
editor
include
map
pathfinder
sound
stratagus
ui
unit
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name action_attack.cpp - The attack action. */
|
||||
//
|
||||
// (c) Copyright 1998-2005 by Lutz Sammer and Jimmy Salmon
|
||||
// (c) Copyright 1998-2007 by Lutz Sammer and Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -90,7 +90,7 @@ void AnimateActionAttack(CUnit *unit)
|
|||
**
|
||||
** @warning The caller must check, if he likes the restored SavedOrder!
|
||||
**
|
||||
** @todo If an unit enters an building, than the attack choose an
|
||||
** @todo If a unit enters an building, than the attack choose an
|
||||
** other goal, perhaps it is better to wait for the goal?
|
||||
**
|
||||
** @param unit Unit using the goal.
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name action_move.cpp - The move action. */
|
||||
//
|
||||
// (c) Copyright 1998-2006 by Lutz Sammer and Jimmy Salmon
|
||||
// (c) Copyright 1998-2007 by Lutz Sammer and Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -182,7 +182,7 @@ int DoActionMove(CUnit *unit)
|
|||
/**
|
||||
** Unit move action:
|
||||
**
|
||||
** Move to a place or to an unit (can move).
|
||||
** Move to a place or to a unit (can move).
|
||||
** Tries 10x to reach the target, note this are the complete tries.
|
||||
** If the target entered another unit, move to it's position.
|
||||
** If the target unit is destroyed, continue to move to it's last position.
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name action_unload.cpp - The unload action. */
|
||||
//
|
||||
// (c) Copyright 1998-2005 by Lutz Sammer and Jimmy Salmon
|
||||
// (c) Copyright 1998-2007 by Lutz Sammer and Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -370,7 +370,7 @@ static void LeaveTransporter(CUnit *unit)
|
|||
}
|
||||
|
||||
/**
|
||||
** The transporter unloads an unit.
|
||||
** The transporter unloads a unit.
|
||||
**
|
||||
** @param unit Pointer to unit.
|
||||
*/
|
||||
|
|
|
@ -446,7 +446,7 @@ static void HandleBuffs(CUnit *unit, int amount)
|
|||
}
|
||||
|
||||
/**
|
||||
** Handle the action of an unit.
|
||||
** Handle the action of a unit.
|
||||
**
|
||||
** @param unit Pointer to handled unit.
|
||||
*/
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name command.cpp - Give units a command. */
|
||||
//
|
||||
// (c) Copyright 1998-2005 by Lutz Sammer and Jimmy Salmon
|
||||
// (c) Copyright 1998-2007 by Lutz Sammer and Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -68,7 +68,7 @@ static void ReleaseOrder(COrder *order)
|
|||
}
|
||||
|
||||
/**
|
||||
** Release all orders of an unit.
|
||||
** Release all orders of a unit.
|
||||
**
|
||||
** @param unit Pointer to unit.
|
||||
*/
|
||||
|
@ -497,7 +497,7 @@ void CommandAttackGround(CUnit *unit, int x, int y, int flush)
|
|||
}
|
||||
|
||||
/**
|
||||
** Let an unit patrol from current to new position
|
||||
** Let a unit patrol from current to new position
|
||||
**
|
||||
** FIXME: want to support patroling between units.
|
||||
**
|
||||
|
@ -664,7 +664,7 @@ void CommandBuildBuilding(CUnit *unit, int x, int y,
|
|||
}
|
||||
|
||||
/**
|
||||
** Cancel the building construction, or kill an unit.
|
||||
** Cancel the building construction, or kill a unit.
|
||||
**
|
||||
** @param unit pointer to unit.
|
||||
*/
|
||||
|
@ -764,7 +764,7 @@ void CommandReturnGoods(CUnit *unit, CUnit *goal, int flush)
|
|||
}
|
||||
|
||||
/**
|
||||
** Building starts training an unit.
|
||||
** Building starts training a unit.
|
||||
**
|
||||
** @param unit pointer to unit.
|
||||
** @param type unit type to train.
|
||||
|
@ -808,7 +808,7 @@ void CommandTrainUnit(CUnit *unit, CUnitType *type, int flush)
|
|||
}
|
||||
|
||||
/**
|
||||
** Cancel the training of an unit.
|
||||
** Cancel the training of a unit.
|
||||
**
|
||||
** @param unit pointer to unit.
|
||||
** @param slot slot number to cancel.
|
||||
|
@ -930,7 +930,7 @@ void CommandSpellCast(CUnit *unit, int x, int y, CUnit *dest,
|
|||
// Unit::Refs is used as timeout counter.
|
||||
//
|
||||
if (dest->Destroyed) {
|
||||
// FIXME: where check if spell needs an unit as destination?
|
||||
// FIXME: where check if spell needs a unit as destination?
|
||||
// FIXME: dest->Type is now set to 0. maybe we shouldn't bother.
|
||||
order->X = dest->X /*+ dest->Type->TileWidth / 2*/ - order->Range;
|
||||
order->Y = dest->Y /*+ dest->Type->TileHeight / 2*/ - order->Range;
|
||||
|
|
12
ai/ai.cpp
12
ai/ai.cpp
|
@ -97,11 +97,11 @@
|
|||
**
|
||||
** ::AiHelpMe()
|
||||
**
|
||||
** Called if an unit owned by the AI is attacked.
|
||||
** Called if a unit owned by the AI is attacked.
|
||||
**
|
||||
** ::AiUnitKilled()
|
||||
**
|
||||
** Called if an unit owned by the AI is killed.
|
||||
** Called if a unit owned by the AI is killed.
|
||||
**
|
||||
** ::AiNeedMoreSupply()
|
||||
**
|
||||
|
@ -110,7 +110,7 @@
|
|||
**
|
||||
** ::AiWorkComplete()
|
||||
**
|
||||
** Called if an unit has completed its work.
|
||||
** Called if a unit has completed its work.
|
||||
**
|
||||
** ::AiCanNotBuild()
|
||||
**
|
||||
|
@ -742,7 +742,7 @@ void AiHelpMe(const CUnit *attacker, CUnit *defender)
|
|||
}
|
||||
|
||||
/**
|
||||
** Called if an unit is killed.
|
||||
** Called if a unit is killed.
|
||||
**
|
||||
** @param unit Pointer to unit.
|
||||
*/
|
||||
|
@ -961,7 +961,7 @@ static void AiMoveUnitInTheWay(CUnit *unit)
|
|||
}
|
||||
|
||||
/**
|
||||
** Called if an unit can't move. Try to move unit in the way
|
||||
** Called if a unit can't move. Try to move unit in the way
|
||||
**
|
||||
** @param unit Pointer to unit what builds the building.
|
||||
*/
|
||||
|
@ -1012,7 +1012,7 @@ void AiNeedMoreSupply(const CUnit *unit, const CUnitType *what)
|
|||
}
|
||||
|
||||
/**
|
||||
** Called if training of an unit is completed.
|
||||
** Called if training of a unit is completed.
|
||||
**
|
||||
** @param unit Pointer to unit making.
|
||||
** @param what Pointer to new ready trained unit.
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name ai_force.cpp - AI force functions. */
|
||||
//
|
||||
// (c) Copyright 2001-2005 by Lutz Sammer and Jimmy Salmon
|
||||
// (c) Copyright 2001-2007 by Lutz Sammer and Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name ai_local.h - The local AI header file. */
|
||||
//
|
||||
// (c) Copyright 2000-2005 by Lutz Sammer and Antonis Chaniotis.
|
||||
// (c) Copyright 2000-2007 by Lutz Sammer and Antonis Chaniotis.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -225,7 +225,7 @@ public:
|
|||
/**
|
||||
** AI Helper.
|
||||
**
|
||||
** Contains informations needed for the AI. If the AI needs an unit or
|
||||
** Contains informations needed for the AI. If the AI needs a unit or
|
||||
** building or upgrade or spell, it could lookup in this tables to find
|
||||
** where it could be trained or built.
|
||||
*/
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name ai_resource.cpp - AI resource manager. */
|
||||
//
|
||||
// (c) Copyright 2000-2005 by Lutz Sammer and Antonis Chaniotis.
|
||||
// (c) Copyright 2000-2007 by Lutz Sammer and Antonis Chaniotis.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -165,7 +165,7 @@ static int AiCheckSupply(const PlayerAi *pai, const CUnitType *type)
|
|||
}
|
||||
|
||||
/**
|
||||
** Check if the costs for an unit-type are available for the AI.
|
||||
** Check if the costs for a unit-type are available for the AI.
|
||||
**
|
||||
** Take reserve and already used resources into account.
|
||||
**
|
||||
|
@ -420,7 +420,7 @@ int AiCountUnitBuilders(CUnitType *type)
|
|||
return 0;
|
||||
}
|
||||
//
|
||||
// Check if we have a place for building or an unit to build.
|
||||
// Check if we have a place for building or a unit to build.
|
||||
//
|
||||
if (type->Building) {
|
||||
n = AiHelpers.Build.size();
|
||||
|
@ -451,7 +451,7 @@ int AiCountUnitBuilders(CUnitType *type)
|
|||
}
|
||||
|
||||
/**
|
||||
** Check if we can make an unit-type.
|
||||
** Check if we can make a unit-type.
|
||||
**
|
||||
** @param type Unit-type that must be made.
|
||||
**
|
||||
|
@ -480,7 +480,7 @@ static int AiMakeUnit(CUnitType *type)
|
|||
type = UnitTypes[usableTypes[currentType]];
|
||||
|
||||
//
|
||||
// Check if we have a place for building or an unit to build.
|
||||
// Check if we have a place for building or a unit to build.
|
||||
//
|
||||
if (type->Building) {
|
||||
n = AiHelpers.Build.size();
|
||||
|
@ -853,7 +853,7 @@ static void AiCollectResources(void)
|
|||
}
|
||||
|
||||
//
|
||||
// We just moved an unit. Adjust priority & retry
|
||||
// We just moved a unit. Adjust priority & retry
|
||||
//
|
||||
if (unit) {
|
||||
// i got a new unit.
|
||||
|
@ -1022,7 +1022,7 @@ static int AiRepairUnit(CUnit *unit)
|
|||
}
|
||||
|
||||
/**
|
||||
** Look through the units, if an unit must be repaired.
|
||||
** Look through the units, if a unit must be repaired.
|
||||
*/
|
||||
static void AiCheckRepair(void)
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name script_ai.cpp - The AI ccl functions. */
|
||||
//
|
||||
// (c) Copyright 2000-2006 by Lutz Sammer, Ludovic Pollet,
|
||||
// (c) Copyright 2000-2007 by Lutz Sammer, Ludovic Pollet,
|
||||
// and Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
|
@ -533,7 +533,7 @@ static int CclAiSet(lua_State *l)
|
|||
}
|
||||
|
||||
/**
|
||||
** Wait for an unit.
|
||||
** Wait for a unit.
|
||||
**
|
||||
** @param l Lua State.
|
||||
**
|
||||
|
|
|
@ -976,7 +976,7 @@ static void DrawMapCursor(void)
|
|||
PopClipping();
|
||||
} else {
|
||||
//
|
||||
// If there is an unit under the cursor, it's selection thing
|
||||
// If there is a unit under the cursor, it's selection thing
|
||||
// is drawn somewhere else (Check DrawUnitSelection.)
|
||||
//
|
||||
if (!UnitUnderCursor) {
|
||||
|
@ -1894,7 +1894,7 @@ static void EditorCallbackMouse(int x, int y)
|
|||
CursorOn = CursorOnMap;
|
||||
|
||||
//
|
||||
// Look if there is an unit under the cursor.
|
||||
// Look if there is a unit under the cursor.
|
||||
// FIXME: use Viewport2MapX Viewport2MapY
|
||||
//
|
||||
UnitUnderCursor = UnitOnScreen(NULL,
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name actions.h - The actions headerfile. */
|
||||
//
|
||||
// (c) Copyright 1998-2006 by Lutz Sammer and Jimmy Salmon
|
||||
// (c) Copyright 1998-2007 by Lutz Sammer and Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -64,7 +64,7 @@ extern unsigned SyncHash; /// Hash calculated to find sync failures
|
|||
----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
** This functions gives an unit a new command. If the command is given
|
||||
** This function gives a unit a new command. If the command is given
|
||||
** by the user the function with Send prefix should be used.
|
||||
*/
|
||||
|
||||
|
@ -182,7 +182,7 @@ extern int UnitShowAnimationScaled(CUnit *unit, const CAnimation *anim, int scal
|
|||
extern int UnitShowAnimation(CUnit *unit, const CAnimation *anim);
|
||||
/// Handle the actions of all units each game cycle
|
||||
extern void UnitActions(void);
|
||||
/// Unload an unit.
|
||||
/// Unload a unit.
|
||||
extern int UnloadUnit(CUnit *unit);
|
||||
//@}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name depend.h - The units dependencies headerfile. */
|
||||
//
|
||||
// (c) Copyright 2000-2004 by Vladi Belperchinov-Shabanski
|
||||
// (c) Copyright 2000-2007 by Vladi Belperchinov-Shabanski
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -68,7 +68,7 @@
|
|||
**
|
||||
** DependRule::Type
|
||||
**
|
||||
** Type of the rule, DependRuleUnitType for an unit-type,
|
||||
** Type of the rule, DependRuleUnitType for a unit-type,
|
||||
** DependRuleUpgrade for an upgrade.
|
||||
**
|
||||
** DependRule::Kind
|
||||
|
@ -94,7 +94,7 @@ class CPlayer;
|
|||
class CUnitType;
|
||||
|
||||
enum {
|
||||
DependRuleUnitType, /// Kind is an unit-type
|
||||
DependRuleUnitType, /// Kind is a unit-type
|
||||
};
|
||||
|
||||
/// Dependency rule
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name icons.h - The icons headerfile. */
|
||||
//
|
||||
// (c) Copyright 1998-2005 by Lutz Sammer
|
||||
// (c) Copyright 1998-2007 by Lutz Sammer
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -113,7 +113,7 @@ public:
|
|||
|
||||
/// Draw icon
|
||||
void DrawIcon(const CPlayer *player, int x, int y) const;
|
||||
/// Draw icon of an unit
|
||||
/// Draw icon of a unit
|
||||
void DrawUnitIcon(const CPlayer *player, ButtonStyle *style,
|
||||
unsigned flags, int x, int y, const std::string &text) const;
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@
|
|||
** This structure contains all information about a missile in game.
|
||||
** A missile could have different effects, based on its missile-type.
|
||||
** Missiles could be saved and stored with CCL. See (missile).
|
||||
** Currently only a tile, an unit or a missile could be placed on the map.
|
||||
** Currently only a tile, a unit or a missile could be placed on the map.
|
||||
**
|
||||
**
|
||||
** The missile structure members:
|
||||
|
|
|
@ -351,13 +351,13 @@ public:
|
|||
|
||||
/// Add costs to the resources
|
||||
void AddCosts(const int *costs);
|
||||
/// Add costs for an unit-type to the resources
|
||||
/// Add costs for a unit-type to the resources
|
||||
void AddUnitType(const CUnitType *type);
|
||||
/// Add a factor of costs to the resources
|
||||
void AddCostsFactor(const int *costs, int factor);
|
||||
/// Remove costs from the resources
|
||||
void SubCosts(const int *costs);
|
||||
/// Remove costs for an unit-type from the resources
|
||||
/// Remove costs for a unit-type from the resources
|
||||
void SubUnitType(const CUnitType *type);
|
||||
/// Remove a factor of costs from the resources
|
||||
void SubCostsFactor(const int *costs, int factor);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name ui.h - The user interface header file. */
|
||||
//
|
||||
// (c) Copyright 1999-2006 by Lutz Sammer and Jimmy Salmon
|
||||
// (c) Copyright 1999-2007 by Lutz Sammer and Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -142,7 +142,7 @@ public:
|
|||
**
|
||||
** CViewport::Unit
|
||||
**
|
||||
** Viewport is bound to an unit. If the unit moves the viewport
|
||||
** Viewport is bound to a unit. If the unit moves the viewport
|
||||
** changes the position together with the unit.
|
||||
** @todo binding to a group.
|
||||
*/
|
||||
|
|
|
@ -181,7 +181,7 @@ int CheckedCanMoveToMask(int x, int y, int mask)
|
|||
}
|
||||
|
||||
/**
|
||||
** Can an unit of unit-type be placed at this point.
|
||||
** Can a unit of unit-type be placed at this point.
|
||||
**
|
||||
** @param type unit-type to be checked.
|
||||
** @param x X map tile position.
|
||||
|
@ -208,7 +208,7 @@ int UnitTypeCanBeAt(const CUnitType *type, int x, int y)
|
|||
}
|
||||
|
||||
/**
|
||||
** Can an unit be placed to this point.
|
||||
** Can a unit be placed to this point.
|
||||
**
|
||||
** @param unit unit to be checked.
|
||||
** @param x X map tile position.
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name minimap.cpp - The minimap. */
|
||||
//
|
||||
// (c) Copyright 1998-2006 by Lutz Sammer and Jimmy Salmon
|
||||
// (c) Copyright 1998-2007 by Lutz Sammer and Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -438,7 +438,7 @@ void CMinimap::UpdateXY(int tx, int ty)
|
|||
}
|
||||
|
||||
/**
|
||||
** Draw an unit on the minimap.
|
||||
** Draw a unit on the minimap.
|
||||
*/
|
||||
static void DrawUnitOn(CUnit *unit, int red_phase)
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
//
|
||||
// I use breadth-first.
|
||||
//
|
||||
// (c) Copyright 1998-2006 by Lutz Sammer, Russell Smith
|
||||
// (c) Copyright 1998-2007 by Lutz Sammer, Russell Smith
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -192,7 +192,7 @@ int UnitReachable(const CUnit *src, const CUnit *dst, int range)
|
|||
/**
|
||||
** Find new path.
|
||||
**
|
||||
** The destination could be an unit or a field.
|
||||
** The destination could be a unit or a field.
|
||||
** Range gives how far we must reach the goal.
|
||||
**
|
||||
** @note The destination could become negative coordinates!
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name sound.cpp - The sound. */
|
||||
//
|
||||
// (c) Copyright 1998-2005 by Lutz Sammer, Fabrice Rossi,
|
||||
// (c) Copyright 1998-2007 by Lutz Sammer, Fabrice Rossi,
|
||||
// and Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
|
@ -277,7 +277,7 @@ static char CalculateStereo(const CUnit *unit)
|
|||
}
|
||||
|
||||
/**
|
||||
** Ask to the sound server to play a sound attached to an unit. The
|
||||
** Ask to the sound server to play a sound attached to a unit. The
|
||||
** sound server may discard the sound if needed (e.g., when the same
|
||||
** unit is already speaking).
|
||||
**
|
||||
|
@ -303,7 +303,7 @@ void PlayUnitSound(const CUnit *unit, UnitVoiceGroup voice)
|
|||
}
|
||||
|
||||
/**
|
||||
** Ask to the sound server to play a sound attached to an unit. The
|
||||
** Ask to the sound server to play a sound attached to a unit. The
|
||||
** sound server may discard the sound if needed (e.g., when the same
|
||||
** unit is already speaking).
|
||||
**
|
||||
|
|
|
@ -585,7 +585,7 @@ void CPlayer::AddCosts(const int *costs)
|
|||
}
|
||||
|
||||
/**
|
||||
** Add the costs of an unit type to resources
|
||||
** Add the costs of a unit type to resources
|
||||
**
|
||||
** @param type Type of unit.
|
||||
*/
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name spells.cpp - The spell cast action. */
|
||||
//
|
||||
// (c) Copyright 1998-2006 by Vladi Belperchinov-Shabanski, Lutz Sammer,
|
||||
// (c) Copyright 1998-2007 by Vladi Belperchinov-Shabanski, Lutz Sammer,
|
||||
// Jimmy Salmon, and Joris DAUPHIN
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
|
@ -757,8 +757,8 @@ static Target *NewTargetPosition(int x, int y)
|
|||
** @param caster Pointer to caster unit.
|
||||
** @param spell Pointer to the spell to cast.
|
||||
** @param target Pointer to target unit, or 0 if it is a position spell.
|
||||
** @param x X position, or -1 if it is an unit spell.
|
||||
** @param y Y position, or -1 if it is an unit spell.
|
||||
** @param x X position, or -1 if it is a unit spell.
|
||||
** @param y Y position, or -1 if it is a unit spell.
|
||||
** @param condition Pointer to condition info.
|
||||
**
|
||||
** @return 1 if passed, 0 otherwise.
|
||||
|
@ -771,7 +771,7 @@ static int PassCondition(const CUnit *caster, const SpellType *spell, const CUni
|
|||
if (caster->Variable[MANA_INDEX].Value < spell->ManaCost) { // Check caster mana.
|
||||
return 0;
|
||||
}
|
||||
if (spell->Target == TargetUnit) { // Casting an unit spell without a target.
|
||||
if (spell->Target == TargetUnit) { // Casting a unit spell without a target.
|
||||
if ((!target) || target->Destroyed || target->Orders[0]->Action == UnitActionDie) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name mainscr.cpp - The main screen. */
|
||||
//
|
||||
// (c) Copyright 1998-2006 by Lutz Sammer, Valery Shchedrin, and
|
||||
// (c) Copyright 1998-2007 by Lutz Sammer, Valery Shchedrin, and
|
||||
// Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
|
@ -282,7 +282,7 @@ UStrInt GetComponent(const CUnit *unit, int index, EnumVariable e, int t)
|
|||
}
|
||||
|
||||
/**
|
||||
** Get unit from an unit depending of the relation.
|
||||
** Get unit from a unit depending of the relation.
|
||||
**
|
||||
** @param unit unit reference.
|
||||
** @param e relation with unit.
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name mouse.cpp - The mouse handling. */
|
||||
//
|
||||
// (c) Copyright 1998-2006 by Lutz Sammer and Jimmy Salmon
|
||||
// (c) Copyright 1998-2007 by Lutz Sammer and Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -1393,7 +1393,7 @@ void UIHandleButtonDown(unsigned button)
|
|||
// to redraw the cursor immediately (and avoid up to 1 sec delay
|
||||
if (CursorBuilding) {
|
||||
// Possible Selected[0] was removed from map
|
||||
// need to make sure there is an unit to build
|
||||
// need to make sure there is a unit to build
|
||||
if (Selected[0] && (MouseButtons & LeftButton) &&
|
||||
UI.MouseViewport->IsInsideMapArea(CursorX, CursorY)) {// enter select mode
|
||||
int explored;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name unit.cpp - The units. */
|
||||
//
|
||||
// (c) Copyright 1998-2005 by Lutz Sammer and Jimmy Salmon
|
||||
// (c) Copyright 1998-2007 by Lutz Sammer and Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -135,7 +135,7 @@ void CUnit::RefsDecrease()
|
|||
}
|
||||
|
||||
/**
|
||||
** Release an unit.
|
||||
** Release a unit.
|
||||
**
|
||||
** The unit is only released, if all references are dropped.
|
||||
*/
|
||||
|
@ -659,7 +659,7 @@ static void RemoveUnitFromContainer(CUnit *unit)
|
|||
|
||||
|
||||
/**
|
||||
** Affect Tile coord of an unit (with units inside) to tile (x, y).
|
||||
** Affect Tile coord of a unit (with units inside) to tile (x, y).
|
||||
**
|
||||
** @param unit unit to move.
|
||||
** @param x X map tile position.
|
||||
|
@ -1051,7 +1051,7 @@ void UnitGoesUnderFog(CUnit *unit, const CPlayer *player)
|
|||
//
|
||||
// Icky yucky icky Seen.Destroyed trickery.
|
||||
// We track for each player if he's seen the unit as destroyed.
|
||||
// Remember, an unit is marked Destroyed when it's gone as in
|
||||
// Remember, a unit is marked Destroyed when it's gone as in
|
||||
// completely gone, the corpses vanishes. In that case the unit
|
||||
// only survives since some players did NOT see the unit destroyed.
|
||||
// Keeping trackof that is hard, mostly due to complex shared vision
|
||||
|
@ -1071,7 +1071,7 @@ void UnitGoesUnderFog(CUnit *unit, const CPlayer *player)
|
|||
}
|
||||
|
||||
/**
|
||||
** This function should get called when an unit goes out of fog of war.
|
||||
** This function should get called when a unit goes out of fog of war.
|
||||
**
|
||||
** @param unit The unit that goes out of fog.
|
||||
** @param player The player the unit goes out of fog for.
|
||||
|
@ -1172,8 +1172,8 @@ void UnitsOnTileUnmarkSeen(const CPlayer *player, int x, int y)
|
|||
}
|
||||
|
||||
/**
|
||||
** Recalculates an units visiblity count. This happens really often,
|
||||
** Like every time an unit moves. It's really fast though, since we
|
||||
** Recalculates a units visiblity count. This happens really often,
|
||||
** Like every time a unit moves. It's really fast though, since we
|
||||
** have per-tile counts.
|
||||
**
|
||||
** @param unit pointer to the unit to check if seen
|
||||
|
@ -2244,7 +2244,7 @@ CUnit *CanBuildUnitType(const CUnit *unit, const CUnitType *type, int x, int y,
|
|||
** Range is not circular, but square.
|
||||
** Player is ignored if nil(search the entire map)
|
||||
** Use rvresult if you search for a tile that doesn't
|
||||
** match resmask. Like for a tile where an unit can go
|
||||
** match resmask. Like for a tile where a unit can go
|
||||
** with it's movement mask.
|
||||
**
|
||||
** @return True if wood was found.
|
||||
|
@ -2746,7 +2746,7 @@ CUnit *UnitOnScreen(CUnit *ounit, int x, int y)
|
|||
}
|
||||
|
||||
/**
|
||||
** Let an unit die.
|
||||
** Let a unit die.
|
||||
**
|
||||
** @param unit Unit to be destroyed.
|
||||
*/
|
||||
|
@ -3567,7 +3567,7 @@ void SaveOrder(const COrder *order, CFile *file)
|
|||
}
|
||||
|
||||
/**
|
||||
** Save the state of an unit to file.
|
||||
** Save the state of a unit to file.
|
||||
**
|
||||
** @param unit Unit pointer to be saved.
|
||||
** @param file Output file.
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// Sort of trivial implementation, since most queries are on a single tile.
|
||||
// Unit is just inserted in a double linked list for every tile it's on.
|
||||
//
|
||||
// (c) Copyright 2004-2006 by Crestez Leonard and Jimmy Salmon
|
||||
// (c) Copyright 2004-2007 by Crestez Leonard and Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -168,7 +168,7 @@ int UnitCacheSelect(int x1, int y1, int x2, int y2, CUnit **table)
|
|||
int UnitCacheOnTile(int x, int y, CUnit **table)
|
||||
{
|
||||
//
|
||||
// Unlike in UnitCacheSelect, there's no way an unit can show up twice,
|
||||
// Unlike in UnitCacheSelect, there's no way a unit can show up twice,
|
||||
// so there is no need for Cache Locks.
|
||||
//
|
||||
int n = 0;
|
||||
|
|
|
@ -116,7 +116,7 @@ const CViewport *CurrentViewport; /// FIXME: quick hack for split screen
|
|||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
/**
|
||||
** Show selection marker around an unit.
|
||||
** Show selection marker around a unit.
|
||||
**
|
||||
** @param unit Pointer to unit.
|
||||
*/
|
||||
|
@ -598,7 +598,7 @@ void DrawShadow(const CUnit *unit, const CUnitType *type, int frame,
|
|||
}
|
||||
|
||||
/**
|
||||
** Get the location of an unit's order.
|
||||
** Get the location of a unit's order.
|
||||
**
|
||||
** @param unit Pointer to unit.
|
||||
** @param order Pointer to order.
|
||||
|
@ -762,7 +762,7 @@ static void ShowSingleOrder(const CUnit *unit, int x1, int y1, const COrder *ord
|
|||
}
|
||||
|
||||
/**
|
||||
** Show the current order of an unit.
|
||||
** Show the current order of a unit.
|
||||
**
|
||||
** @param unit Pointer to the unit.
|
||||
*/
|
||||
|
@ -803,7 +803,7 @@ void ShowOrder(const CUnit *unit)
|
|||
}
|
||||
|
||||
/**
|
||||
** Draw additional informations of an unit.
|
||||
** Draw additional informations of a unit.
|
||||
**
|
||||
** @param unit Unit pointer of drawn unit.
|
||||
** @param type Unit-type pointer.
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name unit_find.cpp - The find/select for units. */
|
||||
//
|
||||
// (c) Copyright 1998-2005 by Lutz Sammer and Jimmy Salmon
|
||||
// (c) Copyright 1998-2007 by Lutz Sammer and Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -81,7 +81,7 @@
|
|||
** @param y Map Y tile position.
|
||||
** @param type UnitType::UnitType, naval,fly,land.
|
||||
**
|
||||
** @return Unit, if an unit of correct type is on the field.
|
||||
** @return Unit, if a unit of correct type is on the field.
|
||||
*/
|
||||
CUnit *UnitCacheOnXY(int x, int y, unsigned type)
|
||||
{
|
||||
|
|
|
@ -214,7 +214,7 @@ CAnimations *AnimationsByIdent(const std::string &ident)
|
|||
}
|
||||
|
||||
/**
|
||||
** Save state of an unit-stats to file.
|
||||
** Save state of a unit-stats to file.
|
||||
**
|
||||
** @param stats Unit-stats to save.
|
||||
** @param ident Unit-type ident.
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
/**@name upgrade.cpp - The upgrade/allow functions. */
|
||||
//
|
||||
// (c) Copyright 1999-2005 by Vladi Belperchinov-Shabanski and Jimmy Salmon
|
||||
// (c) Copyright 1999-2007 by Vladi Belperchinov-Shabanski and Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -213,7 +213,7 @@ int UnitTypeIdByIdent(const std::string &ident)
|
|||
// all the following functions are just map handlers, no specific notes
|
||||
|
||||
/**
|
||||
** Change allow for an unit-type.
|
||||
** Change allow for a unit-type.
|
||||
**
|
||||
** @param player Player to change
|
||||
** @param id unit type id
|
||||
|
|
Loading…
Add table
Reference in a new issue