for(row=-1;row<=1;row++) { for(col=-1;col<=1;col++) { sourcePos = currentpos + rotate(WorldRotaion) X (1,Offset*(col+rand), Offset*(row+rand)); destPos = currentpos x 2000 + rotate(WorldRotaion) X (1,Offset*(col+rand), Offset*(row+rand)); MakeNewProjectile(sourcePos, destPos); } }
float DropProbability[] = {0.2, 0.3, 0.5}; Actor* DropTypes[] = {*BP_Pickup_Child_Health, *BP_Pickup_Child_Damage, *BP_PIckup_Child_Ammo}; Drop() { ProbThisTime = rand() /float(RAND_MAX) TotalProb = DropProbability[0] i = 0 while (i < DrpProbabilitiy.size() and TotalProb <= ProbThisTime) i++ TotalProb = DropProbability[i] DropItem(DropTypes[i] }