Wiggle wiggle
Torrent needs seeds, at least long enough so one of us can get it and seed ourselves.
//Note: single player order has been changed. The Previous mission 3 // where the player meets the traders and fights the Turanic raiders // has been moved to mission 4. Previous mission 4 (capture the // enemy ship, see the destruction of your homeworld) now happens // in mission 3 with a new background (you fly back to your homeworld). // This explains the weird ordering of the NISs //Note2:In addition, the previous mission 15 (mining base) has been moved // to Mission 14, with the Headshot asteroid level (old mission 14) // is now Mission 15. The only change this effects is the nislet names
real32 GetStrengthOfShip(Ship *ship) { // for now, just return RU cost of ship: if (ship->shiptype == Mothership) { return 0.0f; } return (real32)ship->staticinfo->buildCost; }
void GetFleetStrengthInUniverseOfPlayer(Player *player) { Node *objnode = universe.ShipList.head; Ship *ship; spFleetStr = 0.0f; while (objnode != NULL) { ship = (Ship *)listGetStructOfNode(objnode); dbgAssert(ship->objtype == OBJ_ShipType); if (ship->playerowner == player) { spFleetStr += GetStrengthOfShip(ship); // also check ships inside it: if ((ship->shipsInsideMe != NULL) && (ship->shiptype != DDDFrigate)) { // check ships inside too Node *insidenode = ship->shipsInsideMe->insideList.head; InsideShip *insideship2; while (insidenode != NULL) { insideship2 = (InsideShip *)listGetStructOfNode(insidenode); dbgAssert(insideship2->ship->objtype == OBJ_ShipType); spFleetStr += GetStrengthOfShip(insideship2->ship); insidenode = insidenode->next; } } } objnode = objnode->next; } spFleetStr += GetStrengthOfRUs(player->resourceUnits); }
void SetFleetModifier(sdword level,GetStrengthOfFleet getStrengthOfFleetFunc) { real32 comparestrength,comparestrength2; comparestrength = BaseFleetStrengthForLevel[level]; comparestrength2 = AdvancedFleetStrengthForLevel[level]; if ((comparestrength == 0.0f) || (comparestrength2 <= comparestrength)) { spFleetModifier = 0.0f; return; } getStrengthOfFleetFunc(&universe.players[0]); // set spFleetModifier to 0 to 1 based on spFleetStr commpared to comparestrength and comparestrength2 if (spFleetStr <= comparestrength) { spFleetModifier = 0.0f; return; } else if (spFleetStr >= comparestrength2) { spFleetModifier = 1.0f; return; } else { spFleetModifier = (spFleetStr - comparestrength) / (comparestrength2 - comparestrength); if (spFleetModifier > 1.0f) { spFleetModifier = 1.0f; } else if (spFleetModifier < 0.0f) { spFleetModifier = 0.0f; } } }
if (!singlePlayerGame) { numShipsUpper = 0; } else { if ((numShipsUpper) && (spFleetModifier)) { // set numShips to be between numShips and numShipsUpper, based on spFleetModifier (0 to 1) real32 diff = (real32) (numShipsUpper - numShips); if (numShipsUpper < numShips) dbgFatalf(DBG_Loc,"Error numShipsUpper %d too low on line %s",numShipsUpper,field); else if (numShipsUpper > numShips) { diff *= spFleetModifier; numShips += (udword)(diff + 0.5f); } } }