Relevant code:0.67b1
...
-COB support for Getting/Setting veteran level and unit speed.
The returned veteran level is unit experience multiplied by 100
Unit speed can be set to something nonzero only when the current speed is nonzero, it can always be set to zero.
...
Code: Select all
void CCobInstance::SetUnitVal(int val, int param)
{
#ifndef _CONSOLE
switch(val)
{
case ACTIVATION:
if (param == 0)
unit->Deactivate();
else
unit->Activate();
break;
case STANDINGMOVEORDERS:
break;
case STANDINGFIREORDERS:
break;
case HEALTH:
break;
case INBUILDSTANCE:
//info->AddLine("buildstance %d", param);
unit->inBuildStance = (param != 0);
break;
case BUSY:
busy = (param != 0);
break;
case PIECE_XZ:
break;
case PIECE_Y:
break;
case UNIT_XZ:
break;
case UNIT_Y:
break;
case UNIT_HEIGHT:
break;
case XZ_ATAN:
break;
case XZ_HYPOT:
break;
case ATAN:
break;
case HYPOT:
break;
case GROUND_HEIGHT:
break;
case BUILD_PERCENT_LEFT:
break;
case YARD_OPEN:
if (param == 0) {
if (uh->CanCloseYard(unit))
yardOpen = false;
}
else {
yardOpen = true;
}
break;
case BUGGER_OFF:
if (param != 0) {
helper->BuggerOff(unit->pos+unit->frontdir*unit->radius,unit->radius*1.5);
}
//yardOpen = (param != 0);
break;
case ARMORED:
if(param){
unit->curArmorMultiple=unit->armoredMultiple;
} else {
unit->curArmorMultiple=1;
}
unit->armoredState = (param != 0);
break;
default:
info->AddLine("CobError: Unknown set constant %d", val);
case VETERAN_LEVEL:
unit->experience=param*0.01f;
break;
}
#endif
}