Rev 15 | Rev 20 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 15 | Rev 18 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | #include "crush.h" |
1 | #include "crush.h" |
| 2 | #include " |
2 | #include "brender.h" |
| 3 | #include "car.h" |
3 | #include "car.h" |
| 4 | #include "displays.h" |
4 | #include "displays.h" |
| 5 | #include "globvars.h" |
5 | #include "globvars.h" |
| 6 | #include "globvrkm.h" |
6 | #include "globvrkm.h" |
| 7 | #include "globvrpb.h" |
7 | #include "globvrpb.h" |
| Line 483... | Line 483... | ||
| 483 | } |
483 | } |
| 484 | } |
484 | } |
| 485 | memcpy(the_car_actor->actor->model->vertices, |
485 | memcpy(the_car_actor->actor->model->vertices, |
| 486 | the_car_actor->undamaged_vertices, |
486 | the_car_actor->undamaged_vertices, |
| 487 | the_car_actor->actor->model->nvertices * sizeof(br_vertex)); |
487 | the_car_actor->actor->model->nvertices * sizeof(br_vertex)); |
| 488 | // FIXME: BrModelUpdate(..., BR_MODU_VERTEX_COLOURS | BR_MODU_VERTEX_POSITIONS) fails on TELL_ME_IF_WE_PASS_THIS_WAY |
- | |
| 489 |
|
488 | BrModelUpdate(the_car_actor->actor->model, BR_MODU_VERTEX_COLOURS | BR_MODU_VERTEX_POSITIONS); |
| 490 | BrModelUpdate(the_car_actor->actor->model, BR_MODU_ALL); |
- | |
| 491 | if (pipe_vertex_count != 0 && IsActionReplayAvailable()) { |
489 | if (pipe_vertex_count != 0 && IsActionReplayAvailable()) { |
| 492 | PipeSingleModelGeometry(pCar->car_ID, j, pipe_vertex_count, pipe_array); |
490 | PipeSingleModelGeometry(pCar->car_ID, j, pipe_vertex_count, pipe_array); |
| 493 | } |
491 | } |
| 494 | } |
492 | } |
| 495 | } |
493 | } |
| Line 661... | Line 659... | ||
| 661 | } |
659 | } |
| 662 | } |
660 | } |
| 663 | 661 | ||
| 664 | // IDA: void __usercall DoPratcamHit(br_vector3 *pHit_vector@<EAX>) |
662 | // IDA: void __usercall DoPratcamHit(br_vector3 *pHit_vector@<EAX>) |
| 665 | void DoPratcamHit(br_vector3* pHit_vector) { |
663 | void DoPratcamHit(br_vector3* pHit_vector) { |
| 666 |
|
664 | int strength_modifier; |
| 667 |
|
665 | br_scalar strength; |
| 668 | LOG_TRACE("(%p)", pHit_vector); |
666 | LOG_TRACE("(%p)", pHit_vector); |
| 669 | 667 | ||
| - | 668 | strength = BrVector3LengthSquared(pHit_vector); |
|
| - | 669 | if (strength > 0.2f) { |
|
| - | 670 | strength_modifier = 8; |
|
| - | 671 | } else if (strength > 0.015f) { |
|
| - | 672 | strength_modifier = 4; |
|
| - | 673 | } else if (strength >= 0.001f) { |
|
| - | 674 | strength_modifier = 0; |
|
| - | 675 | } else { |
|
| 670 |
|
676 | return; |
| - | 677 | } |
|
| - | 678 | if (fabsf(pHit_vector->v[2]) >= fabsf(pHit_vector->v[0])) { |
|
| - | 679 | if (pHit_vector->v[2] >= 0.f) { |
|
| - | 680 | PratcamEvent(14 + strength_modifier); |
|
| - | 681 | } else { |
|
| - | 682 | PratcamEvent(13 + strength_modifier); |
|
| - | 683 | } |
|
| - | 684 | } else { |
|
| - | 685 | if (pHit_vector->v[0] >= 0.f) { |
|
| - | 686 | PratcamEvent(15 + strength_modifier); |
|
| - | 687 | } else { |
|
| - | 688 | PratcamEvent(16 + strength_modifier); |
|
| - | 689 | } |
|
| - | 690 | } |
|
| 671 | } |
691 | } |
| 672 | 692 | ||
| 673 | // IDA: void __usercall DamageSystems(tCar_spec *pCar@<EAX>, br_vector3 *pImpact_point@<EDX>, br_vector3 *pEnergy_vector@<EBX>, int pWas_hitting_a_car@<ECX>) |
693 | // IDA: void __usercall DamageSystems(tCar_spec *pCar@<EAX>, br_vector3 *pImpact_point@<EDX>, br_vector3 *pEnergy_vector@<EBX>, int pWas_hitting_a_car@<ECX>) |
| 674 | void DamageSystems(tCar_spec* pCar, br_vector3* pImpact_point, br_vector3* pEnergy_vector, int pWas_hitting_a_car) { |
694 | void DamageSystems(tCar_spec* pCar, br_vector3* pImpact_point, br_vector3* pEnergy_vector, int pWas_hitting_a_car) { |
| 675 | int i; |
695 | int i; |
| Line 1153... | Line 1173... | ||
| 1153 | } |
1173 | } |
| 1154 | NetGuaranteedSendMessageToEverybody(gCurrent_net_game, message, NULL); |
1174 | NetGuaranteedSendMessageToEverybody(gCurrent_net_game, message, NULL); |
| 1155 | NetEarnCredits(NetPlayerFromCar(culprit), credits); |
1175 | NetEarnCredits(NetPlayerFromCar(culprit), credits); |
| 1156 | } else { |
1176 | } else { |
| 1157 | PratcamEvent(32); |
1177 | PratcamEvent(32); |
| 1158 | DoFancyHeadup( |
1178 | DoFancyHeadup(kFancyHeadupYouWastedEm); |
| 1159 | credits_squared = sqr(0.7f / victim->car_model_actors[victim->principal_car_actor].crush_data.softness_factor) * gWasted_creds[gProgram_state.skill_level] + 50.0f; |
1179 | credits_squared = sqr(0.7f / victim->car_model_actors[victim->principal_car_actor].crush_data.softness_factor) * gWasted_creds[gProgram_state.skill_level] + 50.0f; |
| 1160 | credits = 100 * (int)(credits_squared / 100.0); |
1180 | credits = 100 * (int)(credits_squared / 100.0); |
| 1161 | AwardTime(gWasted_time[gProgram_state.skill_level]); |
1181 | AwardTime(gWasted_time[gProgram_state.skill_level]); |
| 1162 | EarnCredits(credits); |
1182 | EarnCredits(credits); |
| 1163 | if (victim->can_be_stolen && !gOpponents[victim->index].dead |
1183 | if (victim->can_be_stolen && !gOpponents[victim->index].dead |
| Line 1218... | Line 1238... | ||
| 1218 | if (gNet_mode == eNet_mode_none) { |
1238 | if (gNet_mode == eNet_mode_none) { |
| 1219 | time = 5 * (int)((total_units_of_damage * gCar_time_value[gProgram_state.skill_level] + 2.5f) / 5.0f); |
1239 | time = 5 * (int)((total_units_of_damage * gCar_time_value[gProgram_state.skill_level] + 2.5f) / 5.0f); |
| 1220 | AwardTime(MIN(time, 90)); |
1240 | AwardTime(MIN(time, 90)); |
| 1221 | if (pCar2) { |
1241 | if (pCar2) { |
| 1222 | if (head_on) { |
1242 | if (head_on) { |
| 1223 | DoFancyHeadup( |
1243 | DoFancyHeadup(kFancyHeadupHeadOnBonus); |
| 1224 | } else if (bonus_level <= 2) { |
1244 | } else if (bonus_level <= 2) { |
| 1225 | if (bonus_level > 1) { |
1245 | if (bonus_level > 1) { |
| 1226 | DoFancyHeadup( |
1246 | DoFancyHeadup(kFancyHeadupExtraStyleBonus); |
| 1227 | } |
1247 | } |
| 1228 | } else { |
1248 | } else { |
| 1229 | DoFancyHeadup( |
1249 | DoFancyHeadup(kFancyHeadupBonusForArtisticImpression); |
| 1230 | } |
1250 | } |
| 1231 | } |
1251 | } |
| 1232 | } |
1252 | } |
| 1233 | } |
1253 | } |
| 1234 | for (i = 0; i < COUNT_OF(victim->damage_units); i++) { |
1254 | for (i = 0; i < COUNT_OF(victim->damage_units); i++) { |