작성자 | Drone (121.175.xxx.39) | ||
---|---|---|---|
작성일 | 2010-12-14 23:18:47 KST | 조회 | 600 |
제목 |
여왕 AI스크립트
|
//--------------------------------------------------------------------------------------------------
// *** QUEEN ***
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
order Transfusion (int player, unit aiUnit) {
order ord;
unitgroup group;
aifilter filter;
if (AIIsCampaign(player)) {
if (PlayerDifficulty(player) < c_campAdvanced) {
return null;
}
}
ord = AICreateOrder(player, c_AB_Transfusion, 0);
if (!UnitOrderIsValid(aiUnit, ord)) {
return null;
}
group = AIFindUnits(player, null, UnitGetPosition(aiUnit),
AIAbilityFixed(player, c_AB_Transfusion, c_fieldRange0) + 1,
c_noMaxCount)
;
filter = AIFilter(player);
AISetFilterAlliance(filter, c_playerGroupAlly);
AISetFilterLifeLost(filter, AIEffectFixed(player, c_EF_Transfusion, c_fieldEffectChange0), c_noMax);
group = AIGetFilterGroup(filter, group);
if (group == null) {
return null;
}
return AIUnitGroupGetValidOrder(group, ord, aiUnit, c_forwards);
}
//--------------------------------------------------------------------------------------------------
order SpawnLarva (int player, unit aiUnit) {
order ord;
unitgroup hatcheries;
int larvaCount;
// Only cast if idle.
//
if (UnitOrder(aiUnit, 0) != null) {
return null;
}
ord = AICreateOrder(player, c_AB_SpawnMutantLarva, 0);
if (!UnitOrderIsValid(aiUnit, ord)) {
return null;
}
// Don't cast if we already own at least 10 larva
//
larvaCount =
TechTreeBehaviorCount(player, c_BF_MutantLarvaTimer, c_techCountQueuedOrBetter) * 4
+ TechTreeUnitCount(player, c_ZU_Larva, c_techCountQueuedOrBetter)
;
if (larvaCount >= 10) {
return null;
}
hatcheries = AIFindUnits(player,
c_ZB_Hatchery_Alias,
UnitGetPosition(aiUnit),
15,
c_noMaxCount)
;
return AIUnitGroupGetValidOrder(hatcheries, ord, aiUnit, c_backwards);
}
//--------------------------------------------------------------------------------------------------
order CreepTumor (int player, unit aiUnit) {
order ord;
point p;
if (AIIsCampaign(player)) {
return null;
}
// Only cast if idle.
//
if (UnitOrder(aiUnit, 0) != null) {
return null;
}
// Save at least 25 energy for spawn larva
if (UnitGetPropertyInt(aiUnit, c_unitPropEnergy, c_unitPropCurrent) <= 50) {
return null;
}
ord = AICreateOrder(player, c_AB_QueenBuild, 0);
if (!UnitOrderIsValid(aiUnit, ord)) {
return null;
}
// Don't cast if there is no creep point set for this player.
p = AIGetBestCreepSpot(player, aiUnit, 9);
if (p == null) {
return null;
}
OrderSetTargetPlacement(ord, p, aiUnit, c_ZU_CreepTumor);
if (!UnitOrderIsValid(aiUnit, ord)) {
return null;
}
return ord;
}
//--------------------------------------------------------------------------------------------------
void AIThinkQueen (int player, unit aiUnit, unitgroup scanGroup) {
order ord;
unit heal;
// burrow
if (AIEvalTacticalData(aiUnit, null)) {
return;
}
ord = SpawnLarva(player, aiUnit);
if (ord != null) {
AICast(aiUnit, ord, c_noMarker, c_castHold);
return;
}
ord = Transfusion(player, aiUnit);
if (ord != null) {
AICast(aiUnit, ord, c_noMarker, c_castHold);
return;
}
ord = CreepTumor(player, aiUnit);
if (ord != null) {
AICast(aiUnit, ord, c_noMarker, c_castRetreat);
return;
}
}
이게 유닛하나의 AI스크립트라면 믿겟습니까?
|
||
|
|
||
|
|
||
|
© PlayXP Inc. All Rights Reserved.