MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DoDynamicFallRight

Function DoDynamicFallRight

Descent3/procedurals.cpp:755–773  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753 }
754}
755void DoDynamicFallRight(int handle, dynamic_proc_element *proc) {
756 PlaceProcPoint(FixToInt(proc->x1), FixToInt(proc->y1), proc->color);
757 proc->frames_left--;
758 if (proc->frames_left < 1)
759 ProcElementUnlink(proc - DynamicProcElements, handle);
760 else {
761 proc->color--;
762 if (proc->color == 0)
763 ProcElementUnlink(proc - DynamicProcElements, handle);
764 else {
765 if (FixToInt(proc->dx) > 0)
766 proc->dx -= FloatToFix(((ps_rand() % 100) / 2000.0));
767 if (FixToInt(proc->dy) < 2)
768 proc->dy += FloatToFix(((ps_rand() % 100) / 1000.0));
769 proc->x1 += proc->dx;
770 proc->y1 += proc->dy;
771 }
772 }
773}
774void AddProcFallLeft(int handle, static_proc_element *proc) {
775 if (proc->frequency == 0 || (FrameCount % proc->frequency) == 0) {
776 // Add a new fizzle

Callers 1

EvaluateFireProceduralFunction · 0.85

Calls 3

PlaceProcPointFunction · 0.85
ProcElementUnlinkFunction · 0.85
ps_randFunction · 0.85

Tested by

no test coverage detected