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

Function AddProcRisingEmber

Descent3/procedurals.cpp:502–520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500 AddProcLightning(proc->x1, proc->y1, dest_x, dest_y, BRIGHT_COLOR, proc);
501}
502void AddProcRisingEmber(int handle, static_proc_element *proc) {
503 if (proc->frequency == 0 || (FrameCount % proc->frequency) == 0) {
504 // Add a new fizzle
505 int num = prand() % 7;
506 for (int i = 0; i < num; i++) {
507 int index = ProcElementAllocate();
508 if (index > -1) {
509 ProcElementLink(index, handle);
510 DynamicProcElements[index].type = proc->type;
511
512 DynamicProcElements[index].x1 = IntToFix((int)proc->x1);
513 DynamicProcElements[index].y1 = IntToFix((int)proc->y1);
514 DynamicProcElements[index].color = BRIGHT_COLOR;
515 DynamicProcElements[index].speed = proc->speed;
516 DynamicProcElements[index].frames_left = (prand() % 10) + 15;
517 }
518 }
519 }
520}
521void DoDynamicRisingEmber(int handle, dynamic_proc_element *proc) {
522 PlaceProcPoint(FixToInt(proc->x1), FixToInt(proc->y1), proc->color);
523 proc->frames_left--;

Callers 1

EvaluateFireProceduralFunction · 0.85

Calls 3

prandFunction · 0.85
ProcElementAllocateFunction · 0.85
ProcElementLinkFunction · 0.85

Tested by

no test coverage detected