SAGA2: Fix warning in motion.h
This commit is contained in:
parent
c7fad67025
commit
2f10c15f9f
2 changed files with 100 additions and 100 deletions
|
@ -620,7 +620,7 @@ void *MotionTask::restore(void *buf) {
|
||||||
enactorID = *((ObjectID *)buf);
|
enactorID = *((ObjectID *)buf);
|
||||||
buf = (ObjectID *)buf + 1;
|
buf = (ObjectID *)buf + 1;
|
||||||
|
|
||||||
enactor = enactorID != Nothing
|
o.enactor = enactorID != Nothing
|
||||||
? (Actor *)GameObject::objectAddress(enactorID)
|
? (Actor *)GameObject::objectAddress(enactorID)
|
||||||
: NULL;
|
: NULL;
|
||||||
}
|
}
|
||||||
|
@ -649,7 +649,7 @@ void *MotionTask::restore(void *buf) {
|
||||||
|| motionType == motionTypeDropObject
|
|| motionType == motionTypeDropObject
|
||||||
|| motionType == motionTypeDropObjectOnObject
|
|| motionType == motionTypeDropObjectOnObject
|
||||||
|| motionType == motionTypeDropObjectOnTAI) {
|
|| motionType == motionTypeDropObjectOnTAI) {
|
||||||
directObject = *((ObjectID *)buf) != Nothing
|
o.directObject = *((ObjectID *)buf) != Nothing
|
||||||
? GameObject::objectAddress(*((ObjectID *)buf))
|
? GameObject::objectAddress(*((ObjectID *)buf))
|
||||||
: NULL;
|
: NULL;
|
||||||
buf = (ObjectID *)buf + 1;
|
buf = (ObjectID *)buf + 1;
|
||||||
|
@ -659,7 +659,7 @@ void *MotionTask::restore(void *buf) {
|
||||||
|
|
||||||
if (motionType == motionTypeUseObjectOnObject
|
if (motionType == motionTypeUseObjectOnObject
|
||||||
|| motionType == motionTypeDropObjectOnObject) {
|
|| motionType == motionTypeDropObjectOnObject) {
|
||||||
indirectObject = *((ObjectID *)buf) != Nothing
|
o.indirectObject = *((ObjectID *)buf) != Nothing
|
||||||
? GameObject::objectAddress(
|
? GameObject::objectAddress(
|
||||||
*((ObjectID *)buf))
|
*((ObjectID *)buf))
|
||||||
: NULL;
|
: NULL;
|
||||||
|
@ -667,7 +667,7 @@ void *MotionTask::restore(void *buf) {
|
||||||
} else {
|
} else {
|
||||||
if (motionType == motionTypeUseObjectOnTAI
|
if (motionType == motionTypeUseObjectOnTAI
|
||||||
|| motionType == motionTypeDropObjectOnTAI) {
|
|| motionType == motionTypeDropObjectOnTAI) {
|
||||||
TAI = *((ActiveItemID *)buf) != NoActiveItem
|
o.TAI = *((ActiveItemID *)buf) != NoActiveItem
|
||||||
? ActiveItem::activeItemAddress(
|
? ActiveItem::activeItemAddress(
|
||||||
*((ActiveItemID *)buf))
|
*((ActiveItemID *)buf))
|
||||||
: NULL;
|
: NULL;
|
||||||
|
@ -682,7 +682,7 @@ void *MotionTask::restore(void *buf) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (motionType == motionTypeUseTAI) {
|
} else if (motionType == motionTypeUseTAI) {
|
||||||
TAI = *((ActiveItemID *)buf) != NoActiveItem
|
o.TAI = *((ActiveItemID *)buf) != NoActiveItem
|
||||||
? ActiveItem::activeItemAddress(*((ActiveItemID *)buf))
|
? ActiveItem::activeItemAddress(*((ActiveItemID *)buf))
|
||||||
: NULL;
|
: NULL;
|
||||||
buf = (ActiveItemID *)buf + 1;
|
buf = (ActiveItemID *)buf + 1;
|
||||||
|
@ -763,16 +763,16 @@ void *MotionTask::restore(void *buf) {
|
||||||
buf = (ObjectID *)buf + 2;
|
buf = (ObjectID *)buf + 2;
|
||||||
|
|
||||||
// Convert IDs to pointers
|
// Convert IDs to pointers
|
||||||
attacker = attackerID != Nothing
|
d.attacker = attackerID != Nothing
|
||||||
? (Actor *)GameObject::objectAddress(attackerID)
|
? (Actor *)GameObject::objectAddress(attackerID)
|
||||||
: NULL;
|
: NULL;
|
||||||
|
|
||||||
defensiveObj = defensiveObjID != Nothing
|
d.defensiveObj = defensiveObjID != Nothing
|
||||||
? GameObject::objectAddress(defensiveObjID)
|
? GameObject::objectAddress(defensiveObjID)
|
||||||
: NULL;
|
: NULL;
|
||||||
|
|
||||||
// Restore the defense flags
|
// Restore the defense flags
|
||||||
defenseFlags = *((uint8 *)buf);
|
d.defenseFlags = *((uint8 *)buf);
|
||||||
buf = (uint8 *)buf + 1;
|
buf = (uint8 *)buf + 1;
|
||||||
|
|
||||||
// Restore the action counter
|
// Restore the action counter
|
||||||
|
@ -794,7 +794,7 @@ void *MotionTask::restore(void *buf) {
|
||||||
buf = (ObjectID *)buf + 1;
|
buf = (ObjectID *)buf + 1;
|
||||||
|
|
||||||
// Convert ID to pointer
|
// Convert ID to pointer
|
||||||
attacker = attackerID != Nothing
|
d.attacker = attackerID != Nothing
|
||||||
? (Actor *)GameObject::objectAddress(attackerID)
|
? (Actor *)GameObject::objectAddress(attackerID)
|
||||||
: NULL;
|
: NULL;
|
||||||
|
|
||||||
|
@ -915,7 +915,7 @@ int32 MotionTask::archiveSize(void) {
|
||||||
size += sizeof(direction)
|
size += sizeof(direction)
|
||||||
+ sizeof(ObjectID) // attacker ID
|
+ sizeof(ObjectID) // attacker ID
|
||||||
+ sizeof(ObjectID) // defensiveObj ID
|
+ sizeof(ObjectID) // defensiveObj ID
|
||||||
+ sizeof(defenseFlags)
|
+ sizeof(d.defenseFlags)
|
||||||
+ sizeof(actionCounter);
|
+ sizeof(actionCounter);
|
||||||
|
|
||||||
if (motionType = motionTypeOneHandedParry)
|
if (motionType = motionTypeOneHandedParry)
|
||||||
|
@ -1025,8 +1025,8 @@ void *MotionTask::archive(void *buf) {
|
||||||
*((ObjectID *)buf) = targetObjID;
|
*((ObjectID *)buf) = targetObjID;
|
||||||
buf = (ObjectID *)buf + 1;
|
buf = (ObjectID *)buf + 1;
|
||||||
|
|
||||||
enactorID = enactor != NULL
|
enactorID = o.enactor != NULL
|
||||||
? enactor->thisID()
|
? o.enactor->thisID()
|
||||||
: Nothing;
|
: Nothing;
|
||||||
|
|
||||||
*((ObjectID *)buf) = enactorID;
|
*((ObjectID *)buf) = enactorID;
|
||||||
|
@ -1054,8 +1054,8 @@ void *MotionTask::archive(void *buf) {
|
||||||
|| motionType == motionTypeDropObject
|
|| motionType == motionTypeDropObject
|
||||||
|| motionType == motionTypeDropObjectOnObject
|
|| motionType == motionTypeDropObjectOnObject
|
||||||
|| motionType == motionTypeDropObjectOnTAI) {
|
|| motionType == motionTypeDropObjectOnTAI) {
|
||||||
*((ObjectID *)buf) = directObject != NULL
|
*((ObjectID *)buf) = o.directObject != NULL
|
||||||
? directObject->thisID()
|
? o.directObject->thisID()
|
||||||
: Nothing;
|
: Nothing;
|
||||||
buf = (ObjectID *)buf + 1;
|
buf = (ObjectID *)buf + 1;
|
||||||
|
|
||||||
|
@ -1064,15 +1064,15 @@ void *MotionTask::archive(void *buf) {
|
||||||
|
|
||||||
if (motionType == motionTypeUseObjectOnObject
|
if (motionType == motionTypeUseObjectOnObject
|
||||||
|| motionType == motionTypeDropObjectOnObject) {
|
|| motionType == motionTypeDropObjectOnObject) {
|
||||||
*((ObjectID *)buf) = indirectObject != NULL
|
*((ObjectID *)buf) = o.indirectObject != NULL
|
||||||
? indirectObject->thisID()
|
? o.indirectObject->thisID()
|
||||||
: Nothing;
|
: Nothing;
|
||||||
buf = (ObjectID *)buf + 1;
|
buf = (ObjectID *)buf + 1;
|
||||||
} else {
|
} else {
|
||||||
if (motionType == motionTypeUseObjectOnTAI
|
if (motionType == motionTypeUseObjectOnTAI
|
||||||
|| motionType == motionTypeDropObjectOnTAI) {
|
|| motionType == motionTypeDropObjectOnTAI) {
|
||||||
*((ActiveItemID *)buf) = TAI != NULL
|
*((ActiveItemID *)buf) = o.TAI != NULL
|
||||||
? TAI->thisID()
|
? o.TAI->thisID()
|
||||||
: NoActiveItem;
|
: NoActiveItem;
|
||||||
buf = (ActiveItemID *)buf + 1;
|
buf = (ActiveItemID *)buf + 1;
|
||||||
}
|
}
|
||||||
|
@ -1085,8 +1085,8 @@ void *MotionTask::archive(void *buf) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (motionType == motionTypeUseTAI) {
|
} else if (motionType == motionTypeUseTAI) {
|
||||||
*((ActiveItemID *)buf) = TAI != NULL
|
*((ActiveItemID *)buf) = o.TAI != NULL
|
||||||
? TAI->thisID()
|
? o.TAI->thisID()
|
||||||
: NoActiveItem;
|
: NoActiveItem;
|
||||||
buf = (ActiveItemID *)buf + 1;
|
buf = (ActiveItemID *)buf + 1;
|
||||||
|
|
||||||
|
@ -1161,8 +1161,8 @@ void *MotionTask::archive(void *buf) {
|
||||||
*((Direction *)buf) = direction;
|
*((Direction *)buf) = direction;
|
||||||
buf = (Direction *)buf + 1;
|
buf = (Direction *)buf + 1;
|
||||||
|
|
||||||
attackerID = attacker != NULL ? attacker->thisID() : Nothing;
|
attackerID = d.attacker != NULL ? d.attacker->thisID() : Nothing;
|
||||||
defensiveObjID = defensiveObj != NULL ? defensiveObj->thisID() : Nothing;
|
defensiveObjID = d.defensiveObj != NULL ? d.defensiveObj->thisID() : Nothing;
|
||||||
|
|
||||||
// Store the attacker's and defensive object's IDs
|
// Store the attacker's and defensive object's IDs
|
||||||
*((ObjectID *)buf) = attackerID;
|
*((ObjectID *)buf) = attackerID;
|
||||||
|
@ -1170,7 +1170,7 @@ void *MotionTask::archive(void *buf) {
|
||||||
buf = (ObjectID *)buf + 2;
|
buf = (ObjectID *)buf + 2;
|
||||||
|
|
||||||
// Store the defense flags
|
// Store the defense flags
|
||||||
*((uint8 *)buf) = defenseFlags;
|
*((uint8 *)buf) = d.defenseFlags;
|
||||||
buf = (uint8 *)buf + 1;
|
buf = (uint8 *)buf + 1;
|
||||||
|
|
||||||
// Store the action counter
|
// Store the action counter
|
||||||
|
@ -1187,7 +1187,7 @@ void *MotionTask::archive(void *buf) {
|
||||||
|| motionType == motionTypeFallDown) {
|
|| motionType == motionTypeFallDown) {
|
||||||
ObjectID attackerID;
|
ObjectID attackerID;
|
||||||
|
|
||||||
attackerID = attacker != NULL ? attacker->thisID() : Nothing;
|
attackerID = d.attacker != NULL ? d.attacker->thisID() : Nothing;
|
||||||
|
|
||||||
// Store the attacker's ID
|
// Store the attacker's ID
|
||||||
*((ObjectID *)buf) = attackerID;
|
*((ObjectID *)buf) = attackerID;
|
||||||
|
@ -1396,7 +1396,7 @@ void MotionTask::shootObject(
|
||||||
obj.missileFacing = missileDir(mt->velocity);
|
obj.missileFacing = missileDir(mt->velocity);
|
||||||
|
|
||||||
mt->motionType = motionTypeShot;
|
mt->motionType = motionTypeShot;
|
||||||
mt->enactor = &doer;
|
mt->o.enactor = &doer;
|
||||||
mt->targetObj = ⌖
|
mt->targetObj = ⌖
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1606,7 +1606,7 @@ void MotionTask::useObject(Actor &a, GameObject &dObj) {
|
||||||
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
||||||
if (mt->motionType != motionTypeUseObject) {
|
if (mt->motionType != motionTypeUseObject) {
|
||||||
mt->motionType = motionTypeUseObject;
|
mt->motionType = motionTypeUseObject;
|
||||||
mt->directObject = &dObj;
|
mt->o.directObject = &dObj;
|
||||||
mt->flags = reset;
|
mt->flags = reset;
|
||||||
if (isPlayerActor(&a)) mt->flags |= privledged;
|
if (isPlayerActor(&a)) mt->flags |= privledged;
|
||||||
}
|
}
|
||||||
|
@ -1625,8 +1625,8 @@ void MotionTask::useObjectOnObject(
|
||||||
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
||||||
if (mt->motionType != motionTypeUseObjectOnObject) {
|
if (mt->motionType != motionTypeUseObjectOnObject) {
|
||||||
mt->motionType = motionTypeUseObjectOnObject;
|
mt->motionType = motionTypeUseObjectOnObject;
|
||||||
mt->directObject = &dObj;
|
mt->o.directObject = &dObj;
|
||||||
mt->indirectObject = ⌖
|
mt->o.indirectObject = ⌖
|
||||||
mt->flags = reset;
|
mt->flags = reset;
|
||||||
if (isPlayerActor(&a)) mt->flags |= privledged;
|
if (isPlayerActor(&a)) mt->flags |= privledged;
|
||||||
}
|
}
|
||||||
|
@ -1645,8 +1645,8 @@ void MotionTask::useObjectOnTAI(
|
||||||
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
||||||
if (mt->motionType != motionTypeUseObjectOnTAI) {
|
if (mt->motionType != motionTypeUseObjectOnTAI) {
|
||||||
mt->motionType = motionTypeUseObjectOnTAI;
|
mt->motionType = motionTypeUseObjectOnTAI;
|
||||||
mt->directObject = &dObj;
|
mt->o.directObject = &dObj;
|
||||||
mt->TAI = ⌖
|
mt->o.TAI = ⌖
|
||||||
mt->flags = reset;
|
mt->flags = reset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1664,7 +1664,7 @@ void MotionTask::useObjectOnLocation(
|
||||||
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
||||||
if (mt->motionType != motionTypeUseObjectOnLocation) {
|
if (mt->motionType != motionTypeUseObjectOnLocation) {
|
||||||
mt->motionType = motionTypeUseObjectOnLocation;
|
mt->motionType = motionTypeUseObjectOnLocation;
|
||||||
mt->directObject = &dObj;
|
mt->o.directObject = &dObj;
|
||||||
mt->targetLoc = target;
|
mt->targetLoc = target;
|
||||||
mt->flags = reset;
|
mt->flags = reset;
|
||||||
}
|
}
|
||||||
|
@ -1680,7 +1680,7 @@ void MotionTask::useTAI(Actor &a, ActiveItem &dTAI) {
|
||||||
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
||||||
if (mt->motionType != motionTypeUseTAI) {
|
if (mt->motionType != motionTypeUseTAI) {
|
||||||
mt->motionType = motionTypeUseTAI;
|
mt->motionType = motionTypeUseTAI;
|
||||||
mt->TAI = &dTAI;
|
mt->o.TAI = &dTAI;
|
||||||
mt->flags = reset;
|
mt->flags = reset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1698,7 +1698,7 @@ void MotionTask::dropObject(Actor &a,
|
||||||
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
||||||
if (mt->motionType != motionTypeDropObject) {
|
if (mt->motionType != motionTypeDropObject) {
|
||||||
mt->motionType = motionTypeDropObject;
|
mt->motionType = motionTypeDropObject;
|
||||||
mt->directObject = &dObj;
|
mt->o.directObject = &dObj;
|
||||||
mt->targetLoc = loc;
|
mt->targetLoc = loc;
|
||||||
mt->flags = reset;
|
mt->flags = reset;
|
||||||
mt->moveCount = num;
|
mt->moveCount = num;
|
||||||
|
@ -1733,8 +1733,8 @@ void MotionTask::dropObjectOnObject(
|
||||||
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
||||||
if (mt->motionType != motionTypeDropObjectOnObject) {
|
if (mt->motionType != motionTypeDropObjectOnObject) {
|
||||||
mt->motionType = motionTypeDropObjectOnObject;
|
mt->motionType = motionTypeDropObjectOnObject;
|
||||||
mt->directObject = &dObj;
|
mt->o.directObject = &dObj;
|
||||||
mt->indirectObject = ⌖
|
mt->o.indirectObject = ⌖
|
||||||
mt->flags = reset;
|
mt->flags = reset;
|
||||||
mt->moveCount = num;
|
mt->moveCount = num;
|
||||||
}
|
}
|
||||||
|
@ -1754,8 +1754,8 @@ void MotionTask::dropObjectOnTAI(
|
||||||
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
||||||
if (mt->motionType != motionTypeDropObjectOnTAI) {
|
if (mt->motionType != motionTypeDropObjectOnTAI) {
|
||||||
mt->motionType = motionTypeDropObjectOnTAI;
|
mt->motionType = motionTypeDropObjectOnTAI;
|
||||||
mt->directObject = &dObj;
|
mt->o.directObject = &dObj;
|
||||||
mt->TAI = ⌖
|
mt->o.TAI = ⌖
|
||||||
mt->targetLoc = loc;
|
mt->targetLoc = loc;
|
||||||
mt->flags = reset;
|
mt->flags = reset;
|
||||||
}
|
}
|
||||||
|
@ -1920,11 +1920,11 @@ void MotionTask::twoHandedParry(
|
||||||
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
||||||
if (mt->motionType != motionTypeTwoHandedParry) {
|
if (mt->motionType != motionTypeTwoHandedParry) {
|
||||||
mt->motionType = motionTypeTwoHandedParry;
|
mt->motionType = motionTypeTwoHandedParry;
|
||||||
mt->attacker = &opponent;
|
mt->d.attacker = &opponent;
|
||||||
mt->defensiveObj = &weapon;
|
mt->d.defensiveObj = &weapon;
|
||||||
}
|
}
|
||||||
mt->flags = reset;
|
mt->flags = reset;
|
||||||
mt->defenseFlags = 0;
|
mt->d.defenseFlags = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1940,11 +1940,11 @@ void MotionTask::oneHandedParry(
|
||||||
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
||||||
if (mt->motionType != motionTypeOneHandedParry) {
|
if (mt->motionType != motionTypeOneHandedParry) {
|
||||||
mt->motionType = motionTypeOneHandedParry;
|
mt->motionType = motionTypeOneHandedParry;
|
||||||
mt->attacker = &opponent;
|
mt->d.attacker = &opponent;
|
||||||
mt->defensiveObj = &weapon;
|
mt->d.defensiveObj = &weapon;
|
||||||
}
|
}
|
||||||
mt->flags = reset;
|
mt->flags = reset;
|
||||||
mt->defenseFlags = 0;
|
mt->d.defenseFlags = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1960,11 +1960,11 @@ void MotionTask::shieldParry(
|
||||||
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
||||||
if (mt->motionType != motionTypeShieldParry) {
|
if (mt->motionType != motionTypeShieldParry) {
|
||||||
mt->motionType = motionTypeShieldParry;
|
mt->motionType = motionTypeShieldParry;
|
||||||
mt->attacker = &opponent;
|
mt->d.attacker = &opponent;
|
||||||
mt->defensiveObj = &shield;
|
mt->d.defensiveObj = &shield;
|
||||||
}
|
}
|
||||||
mt->flags = reset;
|
mt->flags = reset;
|
||||||
mt->defenseFlags = 0;
|
mt->d.defenseFlags = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1977,10 +1977,10 @@ void MotionTask::dodge(Actor &a, Actor &opponent) {
|
||||||
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
||||||
if (mt->motionType != motionTypeDodge) {
|
if (mt->motionType != motionTypeDodge) {
|
||||||
mt->motionType = motionTypeDodge;
|
mt->motionType = motionTypeDodge;
|
||||||
mt->attacker = &opponent;
|
mt->d.attacker = &opponent;
|
||||||
}
|
}
|
||||||
mt->flags = reset;
|
mt->flags = reset;
|
||||||
mt->defenseFlags = 0;
|
mt->d.defenseFlags = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1995,7 +1995,7 @@ void MotionTask::acceptHit(Actor &a, Actor &opponent) {
|
||||||
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
||||||
if (mt->motionType != motionTypeAcceptHit) {
|
if (mt->motionType != motionTypeAcceptHit) {
|
||||||
mt->motionType = motionTypeAcceptHit;
|
mt->motionType = motionTypeAcceptHit;
|
||||||
mt->attacker = &opponent;
|
mt->d.attacker = &opponent;
|
||||||
mt->flags = reset;
|
mt->flags = reset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2010,7 +2010,7 @@ void MotionTask::fallDown(Actor &a, Actor &opponent) {
|
||||||
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
if ((mt = mTaskList.newTask(&a)) != NULL) {
|
||||||
if (mt->motionType != motionTypeFallDown) {
|
if (mt->motionType != motionTypeFallDown) {
|
||||||
mt->motionType = motionTypeFallDown;
|
mt->motionType = motionTypeFallDown;
|
||||||
mt->attacker = &opponent;
|
mt->d.attacker = &opponent;
|
||||||
mt->flags = reset;
|
mt->flags = reset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2287,7 +2287,7 @@ void MotionTask::ballisticAction(void) {
|
||||||
// motion as if there was no collision.
|
// motion as if there was no collision.
|
||||||
if (collisionObject == targetObj) {
|
if (collisionObject == targetObj) {
|
||||||
if (object->strike(
|
if (object->strike(
|
||||||
enactor->thisID(),
|
o.enactor->thisID(),
|
||||||
targetObj->thisID())) {
|
targetObj->thisID())) {
|
||||||
// The arrow struck, so delete the arrow and
|
// The arrow struck, so delete the arrow and
|
||||||
// end this motion
|
// end this motion
|
||||||
|
@ -3541,9 +3541,9 @@ uint16 MotionTask::framesUntilStrike(void) {
|
||||||
|
|
||||||
GameObject *MotionTask::blockingObject(Actor *thisAttacker) {
|
GameObject *MotionTask::blockingObject(Actor *thisAttacker) {
|
||||||
return isDefense()
|
return isDefense()
|
||||||
&& (defenseFlags & blocking)
|
&& (d.defenseFlags & blocking)
|
||||||
&& thisAttacker == attacker
|
&& thisAttacker == d.attacker
|
||||||
? defensiveObj
|
? d.defensiveObj
|
||||||
: NULL;
|
: NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3761,7 +3761,7 @@ void MotionTask::twoHandedParryAction(void) {
|
||||||
Actor *a = (Actor *)object;
|
Actor *a = (Actor *)object;
|
||||||
int16 animationFrames;
|
int16 animationFrames;
|
||||||
|
|
||||||
direction = (attacker->getLocation() - a->getLocation()).quickDir();
|
direction = (d.attacker->getLocation() - a->getLocation()).quickDir();
|
||||||
|
|
||||||
if (a->appearance != NULL
|
if (a->appearance != NULL
|
||||||
&& a->isActionAvailable(actionTwoHandParry)) {
|
&& a->isActionAvailable(actionTwoHandParry)) {
|
||||||
|
@ -3796,7 +3796,7 @@ void MotionTask::oneHandedParryAction(void) {
|
||||||
Actor *a = (Actor *)object;
|
Actor *a = (Actor *)object;
|
||||||
int16 animationFrames;
|
int16 animationFrames;
|
||||||
|
|
||||||
direction = (attacker->getLocation() - a->getLocation()).quickDir();
|
direction = (d.attacker->getLocation() - a->getLocation()).quickDir();
|
||||||
|
|
||||||
combatMotionType = oneHandedParryHigh;
|
combatMotionType = oneHandedParryHigh;
|
||||||
if (a->appearance != NULL
|
if (a->appearance != NULL
|
||||||
|
@ -3832,7 +3832,7 @@ void MotionTask::shieldParryAction(void) {
|
||||||
Actor *a = (Actor *)object;
|
Actor *a = (Actor *)object;
|
||||||
int16 animationFrames;
|
int16 animationFrames;
|
||||||
|
|
||||||
direction = (attacker->getLocation() - a->getLocation()).quickDir();
|
direction = (d.attacker->getLocation() - a->getLocation()).quickDir();
|
||||||
|
|
||||||
if (a->appearance != NULL
|
if (a->appearance != NULL
|
||||||
&& a->isActionAvailable(actionShieldParry)) {
|
&& a->isActionAvailable(actionShieldParry)) {
|
||||||
|
@ -3864,7 +3864,7 @@ void MotionTask::shieldParryAction(void) {
|
||||||
|
|
||||||
void MotionTask::dodgeAction(void) {
|
void MotionTask::dodgeAction(void) {
|
||||||
Actor *a = (Actor *)object;
|
Actor *a = (Actor *)object;
|
||||||
MotionTask *attackerMotion = attacker->moveTask;
|
MotionTask *attackerMotion = d.attacker->moveTask;
|
||||||
|
|
||||||
if (flags & reset) {
|
if (flags & reset) {
|
||||||
// If the attacker is not attacking, we're done
|
// If the attacker is not attacking, we're done
|
||||||
|
@ -3933,7 +3933,7 @@ void MotionTask::acceptHitAction(void) {
|
||||||
int16 animationFrames;
|
int16 animationFrames;
|
||||||
|
|
||||||
a->currentFacing =
|
a->currentFacing =
|
||||||
(attacker->getWorldLocation() - a->getLocation()).quickDir();
|
(d.attacker->getWorldLocation() - a->getLocation()).quickDir();
|
||||||
|
|
||||||
if (a->appearance != NULL
|
if (a->appearance != NULL
|
||||||
&& a->isActionAvailable(actionHit, a->currentFacing)) {
|
&& a->isActionAvailable(actionHit, a->currentFacing)) {
|
||||||
|
@ -3991,7 +3991,7 @@ void MotionTask::fallDownAction(void) {
|
||||||
int16 animationFrames;
|
int16 animationFrames;
|
||||||
|
|
||||||
a->currentFacing =
|
a->currentFacing =
|
||||||
(attacker->getWorldLocation() - a->getLocation()).quickDir();
|
(d.attacker->getWorldLocation() - a->getLocation()).quickDir();
|
||||||
|
|
||||||
if (a->appearance != NULL
|
if (a->appearance != NULL
|
||||||
&& a->isActionAvailable(actionKnockedDown, a->currentFacing)) {
|
&& a->isActionAvailable(actionKnockedDown, a->currentFacing)) {
|
||||||
|
@ -4139,10 +4139,10 @@ void MotionTask::useMagicWeaponAction(void) {
|
||||||
|
|
||||||
void MotionTask::defensiveMeleeAction(void) {
|
void MotionTask::defensiveMeleeAction(void) {
|
||||||
Actor *a = (Actor *)object;
|
Actor *a = (Actor *)object;
|
||||||
MotionTask *attackerMotion = attacker->moveTask;
|
MotionTask *attackerMotion = d.attacker->moveTask;
|
||||||
|
|
||||||
// Determine if the blocking action has been initiated
|
// Determine if the blocking action has been initiated
|
||||||
if (!(defenseFlags & blocking)) {
|
if (!(d.defenseFlags & blocking)) {
|
||||||
// If the attacker is not attacking, we're done
|
// If the attacker is not attacking, we're done
|
||||||
if (attackerMotion == NULL
|
if (attackerMotion == NULL
|
||||||
|| !attackerMotion->isMeleeAttack()) {
|
|| !attackerMotion->isMeleeAttack()) {
|
||||||
|
@ -4157,7 +4157,7 @@ void MotionTask::defensiveMeleeAction(void) {
|
||||||
|
|
||||||
// If the strike is about to land start the blocking motion
|
// If the strike is about to land start the blocking motion
|
||||||
if (attackerMotion->framesUntilStrike() <= 1)
|
if (attackerMotion->framesUntilStrike() <= 1)
|
||||||
defenseFlags |= blocking;
|
d.defenseFlags |= blocking;
|
||||||
} else {
|
} else {
|
||||||
// If the actors appearance becomes NULL, make sure this action
|
// If the actors appearance becomes NULL, make sure this action
|
||||||
// no longer depends upon the animation
|
// no longer depends upon the animation
|
||||||
|
@ -4373,32 +4373,32 @@ void MotionTask::updatePositions(void) {
|
||||||
|
|
||||||
// This will be uninterrutable for 2 frames
|
// This will be uninterrutable for 2 frames
|
||||||
a->setActionPoints(2);
|
a->setActionPoints(2);
|
||||||
mt->directObject->use(a->thisID());
|
mt->o.directObject->use(a->thisID());
|
||||||
//nextMT=mt;
|
//nextMT=mt;
|
||||||
moveTaskDone = true;
|
moveTaskDone = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case motionTypeUseObjectOnObject:
|
case motionTypeUseObjectOnObject:
|
||||||
|
|
||||||
if (isWorld(mt->indirectObject->IDParent())) {
|
if (isWorld(mt->o.indirectObject->IDParent())) {
|
||||||
if (
|
if (
|
||||||
1
|
1
|
||||||
#ifdef THIS_SHOULD_BE_IN_TILEMODE
|
#ifdef THIS_SHOULD_BE_IN_TILEMODE
|
||||||
a->inUseRange(
|
a->inUseRange(
|
||||||
mt->indirectObject->getLocation(),
|
mt->o.indirectObject->getLocation(),
|
||||||
mt->directObject)
|
mt->o.directObject)
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
mt->direction = (mt->indirectObject->getLocation()
|
mt->direction = (mt->o.indirectObject->getLocation()
|
||||||
- a->getLocation()).quickDir();
|
- a->getLocation()).quickDir();
|
||||||
if (a->currentFacing != mt->direction)
|
if (a->currentFacing != mt->direction)
|
||||||
a->turn(mt->direction);
|
a->turn(mt->direction);
|
||||||
else {
|
else {
|
||||||
// The actor will now be uniterruptable
|
// The actor will now be uniterruptable
|
||||||
a->setActionPoints(2);
|
a->setActionPoints(2);
|
||||||
mt->directObject->useOn(
|
mt->o.directObject->useOn(
|
||||||
a->thisID(),
|
a->thisID(),
|
||||||
mt->indirectObject->thisID());
|
mt->o.indirectObject->thisID());
|
||||||
if (mt && mt->motionType == motionTypeUseObjectOnObject)
|
if (mt && mt->motionType == motionTypeUseObjectOnObject)
|
||||||
moveTaskDone = true;
|
moveTaskDone = true;
|
||||||
else
|
else
|
||||||
|
@ -4408,9 +4408,9 @@ void MotionTask::updatePositions(void) {
|
||||||
} else {
|
} else {
|
||||||
// The actor will now be uniterruptable
|
// The actor will now be uniterruptable
|
||||||
a->setActionPoints(2);
|
a->setActionPoints(2);
|
||||||
mt->directObject->useOn(
|
mt->o.directObject->useOn(
|
||||||
a->thisID(),
|
a->thisID(),
|
||||||
mt->indirectObject->thisID());
|
mt->o.indirectObject->thisID());
|
||||||
if (mt && mt->motionType == motionTypeUseObjectOnObject)
|
if (mt && mt->motionType == motionTypeUseObjectOnObject)
|
||||||
moveTaskDone = true;
|
moveTaskDone = true;
|
||||||
else
|
else
|
||||||
|
@ -4425,11 +4425,11 @@ void MotionTask::updatePositions(void) {
|
||||||
TilePoint actorLoc = a->getLocation(),
|
TilePoint actorLoc = a->getLocation(),
|
||||||
TAILoc;
|
TAILoc;
|
||||||
TileRegion TAIReg;
|
TileRegion TAIReg;
|
||||||
ActiveItem *TAG = mt->TAI->getGroup();
|
ActiveItem *TAG = mt->o.TAI->getGroup();
|
||||||
|
|
||||||
// Compute in points the region of the TAI
|
// Compute in points the region of the TAI
|
||||||
TAIReg.min.u = mt->TAI->instance.u << tileUVShift;
|
TAIReg.min.u = mt->o.TAI->instance.u << tileUVShift;
|
||||||
TAIReg.min.v = mt->TAI->instance.v << tileUVShift;
|
TAIReg.min.v = mt->o.TAI->instance.v << tileUVShift;
|
||||||
TAIReg.max.u = TAIReg.min.u
|
TAIReg.max.u = TAIReg.min.u
|
||||||
+ (TAG->group.uSize << tileUVShift);
|
+ (TAG->group.uSize << tileUVShift);
|
||||||
TAIReg.max.v = TAIReg.min.v
|
TAIReg.max.v = TAIReg.min.v
|
||||||
|
@ -4451,7 +4451,7 @@ void MotionTask::updatePositions(void) {
|
||||||
else {
|
else {
|
||||||
// The actor will now be uniterruptable
|
// The actor will now be uniterruptable
|
||||||
a->setActionPoints(2);
|
a->setActionPoints(2);
|
||||||
mt->directObject->useOn(a->thisID(), mt->TAI);
|
mt->o.directObject->useOn(a->thisID(), mt->o.TAI);
|
||||||
if (mt && mt->motionType == motionTypeUseObjectOnTAI)
|
if (mt && mt->motionType == motionTypeUseObjectOnTAI)
|
||||||
moveTaskDone = true;
|
moveTaskDone = true;
|
||||||
else
|
else
|
||||||
|
@ -4471,7 +4471,7 @@ void MotionTask::updatePositions(void) {
|
||||||
else {
|
else {
|
||||||
// The actor will now be uniterruptable
|
// The actor will now be uniterruptable
|
||||||
a->setActionPoints(2);
|
a->setActionPoints(2);
|
||||||
mt->directObject->useOn(a->thisID(), mt->targetLoc);
|
mt->o.directObject->useOn(a->thisID(), mt->targetLoc);
|
||||||
if (mt && mt->motionType == motionTypeUseObjectOnLocation)
|
if (mt && mt->motionType == motionTypeUseObjectOnLocation)
|
||||||
moveTaskDone = true;
|
moveTaskDone = true;
|
||||||
else
|
else
|
||||||
|
@ -4485,11 +4485,11 @@ void MotionTask::updatePositions(void) {
|
||||||
TilePoint actorLoc = a->getLocation(),
|
TilePoint actorLoc = a->getLocation(),
|
||||||
TAILoc;
|
TAILoc;
|
||||||
TileRegion TAIReg;
|
TileRegion TAIReg;
|
||||||
ActiveItem *TAG = mt->TAI->getGroup();
|
ActiveItem *TAG = mt->o.TAI->getGroup();
|
||||||
|
|
||||||
// Compute in points the region of the TAI
|
// Compute in points the region of the TAI
|
||||||
TAIReg.min.u = mt->TAI->instance.u << tileUVShift;
|
TAIReg.min.u = mt->o.TAI->instance.u << tileUVShift;
|
||||||
TAIReg.min.v = mt->TAI->instance.v << tileUVShift;
|
TAIReg.min.v = mt->o.TAI->instance.v << tileUVShift;
|
||||||
TAIReg.max.u = TAIReg.min.u
|
TAIReg.max.u = TAIReg.min.u
|
||||||
+ (TAG->group.uSize << tileUVShift);
|
+ (TAG->group.uSize << tileUVShift);
|
||||||
TAIReg.max.v = TAIReg.min.v
|
TAIReg.max.v = TAIReg.min.v
|
||||||
|
@ -4511,7 +4511,7 @@ void MotionTask::updatePositions(void) {
|
||||||
else {
|
else {
|
||||||
// The actor will now be uniterruptable
|
// The actor will now be uniterruptable
|
||||||
a->setActionPoints(2);
|
a->setActionPoints(2);
|
||||||
mt->TAI->use(a->thisID());
|
mt->o.TAI->use(a->thisID());
|
||||||
moveTaskDone = true;
|
moveTaskDone = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -4529,7 +4529,7 @@ void MotionTask::updatePositions(void) {
|
||||||
else {
|
else {
|
||||||
// The actor will now be uniterruptable
|
// The actor will now be uniterruptable
|
||||||
a->setActionPoints(2);
|
a->setActionPoints(2);
|
||||||
mt->directObject->drop(a->thisID(),
|
mt->o.directObject->drop(a->thisID(),
|
||||||
mt->targetLoc,
|
mt->targetLoc,
|
||||||
mt->moveCount);
|
mt->moveCount);
|
||||||
if (mt && mt->motionType == motionTypeDropObject)
|
if (mt && mt->motionType == motionTypeDropObject)
|
||||||
|
@ -4540,7 +4540,7 @@ void MotionTask::updatePositions(void) {
|
||||||
} else {
|
} else {
|
||||||
// The actor will now be uniterruptable
|
// The actor will now be uniterruptable
|
||||||
a->setActionPoints(2);
|
a->setActionPoints(2);
|
||||||
mt->directObject->drop(a->thisID(),
|
mt->o.directObject->drop(a->thisID(),
|
||||||
mt->targetLoc,
|
mt->targetLoc,
|
||||||
mt->moveCount);
|
mt->moveCount);
|
||||||
if (mt && mt->motionType == motionTypeDropObject)
|
if (mt && mt->motionType == motionTypeDropObject)
|
||||||
|
@ -4555,17 +4555,17 @@ void MotionTask::updatePositions(void) {
|
||||||
|
|
||||||
case motionTypeDropObjectOnObject:
|
case motionTypeDropObjectOnObject:
|
||||||
|
|
||||||
if (isWorld(mt->indirectObject->IDParent())) {
|
if (isWorld(mt->o.indirectObject->IDParent())) {
|
||||||
mt->direction = (mt->indirectObject->getLocation()
|
mt->direction = (mt->o.indirectObject->getLocation()
|
||||||
- a->getLocation()).quickDir();
|
- a->getLocation()).quickDir();
|
||||||
if (a->currentFacing != mt->direction)
|
if (a->currentFacing != mt->direction)
|
||||||
a->turn(mt->direction);
|
a->turn(mt->direction);
|
||||||
else {
|
else {
|
||||||
// The actor will now be uniterruptable
|
// The actor will now be uniterruptable
|
||||||
a->setActionPoints(2);
|
a->setActionPoints(2);
|
||||||
mt->directObject->dropOn(
|
mt->o.directObject->dropOn(
|
||||||
a->thisID(),
|
a->thisID(),
|
||||||
mt->indirectObject->thisID(),
|
mt->o.indirectObject->thisID(),
|
||||||
mt->moveCount);
|
mt->moveCount);
|
||||||
if (mt && mt->motionType == motionTypeDropObjectOnObject)
|
if (mt && mt->motionType == motionTypeDropObjectOnObject)
|
||||||
moveTaskDone = true;
|
moveTaskDone = true;
|
||||||
|
@ -4575,9 +4575,9 @@ void MotionTask::updatePositions(void) {
|
||||||
} else {
|
} else {
|
||||||
// The actor will now be uniterruptable
|
// The actor will now be uniterruptable
|
||||||
a->setActionPoints(2);
|
a->setActionPoints(2);
|
||||||
mt->directObject->dropOn(
|
mt->o.directObject->dropOn(
|
||||||
a->thisID(),
|
a->thisID(),
|
||||||
mt->indirectObject->thisID(),
|
mt->o.indirectObject->thisID(),
|
||||||
mt->moveCount);
|
mt->moveCount);
|
||||||
if (mt && mt->motionType == motionTypeDropObjectOnObject)
|
if (mt && mt->motionType == motionTypeDropObjectOnObject)
|
||||||
moveTaskDone = true;
|
moveTaskDone = true;
|
||||||
|
@ -4601,9 +4601,9 @@ void MotionTask::updatePositions(void) {
|
||||||
else {
|
else {
|
||||||
// The actor will now be uniterruptable
|
// The actor will now be uniterruptable
|
||||||
a->setActionPoints(2);
|
a->setActionPoints(2);
|
||||||
mt->directObject->dropOn(
|
mt->o.directObject->dropOn(
|
||||||
a->thisID(),
|
a->thisID(),
|
||||||
mt->TAI,
|
mt->o.TAI,
|
||||||
mt->targetLoc);
|
mt->targetLoc);
|
||||||
if (mt && mt->motionType == motionTypeDropObjectOnTAI)
|
if (mt && mt->motionType == motionTypeDropObjectOnTAI)
|
||||||
moveTaskDone = true;
|
moveTaskDone = true;
|
||||||
|
|
|
@ -131,7 +131,7 @@ class MotionTask : private DNode {
|
||||||
agitated = (1 << 12), // Walking around blockage
|
agitated = (1 << 12), // Walking around blockage
|
||||||
agitatable = (1 << 13), // Will agitate when blocked
|
agitatable = (1 << 13), // Will agitate when blocked
|
||||||
onStairs = (1 << 14), // actor is climbing stairs
|
onStairs = (1 << 14), // actor is climbing stairs
|
||||||
privledged = (1 << 15), // don't let AI interrupt this
|
privledged = (1 << 15) // don't let AI interrupt this
|
||||||
};
|
};
|
||||||
|
|
||||||
Direction direction; // direction of movement
|
Direction direction; // direction of movement
|
||||||
|
@ -161,7 +161,7 @@ class MotionTask : private DNode {
|
||||||
};
|
};
|
||||||
|
|
||||||
enum defenseMotionFlags {
|
enum defenseMotionFlags {
|
||||||
blocking = (1 << 0), // actor is blocking an attack
|
blocking = (1 << 0) // actor is blocking an attack
|
||||||
};
|
};
|
||||||
|
|
||||||
union {
|
union {
|
||||||
|
@ -173,14 +173,14 @@ class MotionTask : private DNode {
|
||||||
// upon.
|
// upon.
|
||||||
Actor *enactor;
|
Actor *enactor;
|
||||||
ActiveItem *TAI; // TAI involved in interation
|
ActiveItem *TAI; // TAI involved in interation
|
||||||
};
|
} o;
|
||||||
|
|
||||||
// Defensive motion stuff
|
// Defensive motion stuff
|
||||||
struct {
|
struct {
|
||||||
Actor *attacker; // attacking actor
|
Actor *attacker; // attacking actor
|
||||||
GameObject *defensiveObj; // shield or parrying weapon
|
GameObject *defensiveObj; // shield or parrying weapon
|
||||||
uint8 defenseFlags; // various combat flags
|
uint8 defenseFlags; // various combat flags
|
||||||
};
|
} d;
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -191,18 +191,18 @@ public:
|
||||||
twoHandedSwingLeftHigh,
|
twoHandedSwingLeftHigh,
|
||||||
twoHandedSwingLeftLow,
|
twoHandedSwingLeftLow,
|
||||||
twoHandedSwingRightHigh,
|
twoHandedSwingRightHigh,
|
||||||
twoHandedSwingRightLow,
|
twoHandedSwingRightLow
|
||||||
};
|
};
|
||||||
|
|
||||||
enum OneHandedSwingTypes {
|
enum OneHandedSwingTypes {
|
||||||
oneHandedSwingHigh,
|
oneHandedSwingHigh,
|
||||||
oneHandedSwingLow,
|
oneHandedSwingLow,
|
||||||
oneHandedThrust,
|
oneHandedThrust
|
||||||
};
|
};
|
||||||
|
|
||||||
enum OneHandedParryTypes {
|
enum OneHandedParryTypes {
|
||||||
oneHandedParryHigh,
|
oneHandedParryHigh,
|
||||||
oneHandedParryLow,
|
oneHandedParryLow
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -253,7 +253,7 @@ private:
|
||||||
// Other combat actions
|
// Other combat actions
|
||||||
motionTypeAcceptHit, // show effect of hit
|
motionTypeAcceptHit, // show effect of hit
|
||||||
motionTypeFallDown, // be knocked off feet
|
motionTypeFallDown, // be knocked off feet
|
||||||
motionTypeDie, // self-explanatory
|
motionTypeDie // self-explanatory
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -525,7 +525,7 @@ public:
|
||||||
|
|
||||||
// Determine if this motion is a dodge motion
|
// Determine if this motion is a dodge motion
|
||||||
bool isDodging(Actor *thisAttacker) {
|
bool isDodging(Actor *thisAttacker) {
|
||||||
return motionType == motionTypeDodge && thisAttacker == attacker;
|
return motionType == motionTypeDodge && thisAttacker == d.attacker;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void initMotionTasks(void);
|
static void initMotionTasks(void);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue