| 700 | } |
| 701 | |
| 702 | static const ThingEffectItem* SelectThingEffect(const ThingEffectItem* list, float value) |
| 703 | { |
| 704 | // value 0..1 |
| 705 | while (list->_probab >= 0) |
| 706 | { |
| 707 | value -= list->_probab; |
| 708 | if (value < 0) |
| 709 | { |
| 710 | return list; |
| 711 | } |
| 712 | list++; |
| 713 | } |
| 714 | Fail("No corresponding effect"); |
| 715 | return nullptr; |
| 716 | } |
| 717 | |
| 718 | Entity* CreateThingEffect(ThingEffectKind kind, // kind |
| 719 | Matrix4Val pos, Vector3Val vel // position and velocity |