Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
fourier.qc File Reference
#include "fourier.qh"
Include dependency graph for fourier.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void func_fourier_controller_think (entity this)
 spawnfunc (func_fourier)

Function Documentation

◆ func_fourier_controller_think()

void func_fourier_controller_think ( entity this)

Definition at line 14 of file fourier.qc.

15{
16 vector v;
17 float n, i, t;
18
19 this.nextthink = time + 0.1;
20 if(this.owner.active != ACTIVE_ACTIVE)
21 {
22 this.owner.velocity = '0 0 0';
23 return;
24 }
25
26
27 n = floor((tokenize_console(this.owner.netname)) / 5);
28 t = this.nextthink * this.owner.cnt + this.owner.phase * 360;
29
30 v = this.owner.destvec;
31
32 for(i = 0; i < n; ++i)
33 {
34 makevectors((t * stof(argv(i*5)) + stof(argv(i*5+1)) * 360) * '0 1 0');
35 v = v + ('1 0 0' * stof(argv(i*5+2)) + '0 1 0' * stof(argv(i*5+3)) + '0 0 1' * stof(argv(i*5+4))) * this.owner.height * v_forward_y;
36 }
37
38 if(this.owner.classname == "func_fourier") // don't brake stuff if the func_fourier was killtarget'ed
39 // * 10 so it will arrive in 0.1 sec
40 this.owner.velocity = (v - this.owner.origin) * 10;
41}
entity owner
Definition main.qh:87
float time
float nextthink
const int ACTIVE_ACTIVE
Definition defs.qh:37
#define tokenize_console
float stof(string val,...)
float floor(float f)
string argv(float n)
#define makevectors
Definition post.qh:21
vector
Definition self.qh:92

References ACTIVE_ACTIVE, argv(), entity(), floor(), makevectors, nextthink, owner, stof(), time, tokenize_console, and vector.

Referenced by spawnfunc().

◆ spawnfunc()

spawnfunc ( func_fourier )

Definition at line 43 of file fourier.qc.

44{
45 entity controller;
46 if (this.noise != "")
47 {
50 }
51
52 if (!this.speed)
53 this.speed = 4;
54 if (!this.height)
55 this.height = 32;
56 this.destvec = this.origin;
57 this.cnt = 360 / this.speed;
58
60 if(this.dmg && (this.message == ""))
61 this.message = " was squished";
62 if(this.dmg && (this.message2 == ""))
63 this.message2 = "was squished by";
64 if(this.dmg && (!this.dmgtime))
65 this.dmgtime = 0.25;
66 this.dmgtime2 = time;
67
68 if(this.netname == "")
69 this.netname = "1 0 0 0 1";
70
71 if (!InitMovingBrushTrigger(this))
72 return;
73
74 this.active = ACTIVE_ACTIVE;
75
76 // wait for targets to spawn
77 controller = new_pure(func_fourier_controller);
78 controller.owner = this;
79 controller.nextthink = time + 1;
81 this.nextthink = this.ltime + 999999999;
82 setthink(this, SUB_NullThink); // for PushMove
83
84 // Savage: Reduce bandwith, critical on e.g. nexdm02
86
87 // TODO make a reset function for this one
88}
float height
Definition bobbing.qc:3
float dmg
Definition breakable.qc:12
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
string netname
Definition powerups.qc:20
float cnt
Definition powerups.qc:24
string message
Definition powerups.qc:19
float effects
vector origin
int active
Definition defs.qh:34
float EF_LOWPRECISION
float speed
Definition dynlight.qc:9
void func_fourier_controller_think(entity this)
Definition fourier.qc:14
string precache_sound(string sample)
float MSG_INIT
Definition menudefs.qc:58
float ltime
Definition net.qc:10
#define new_pure(class)
purely logical entities (not linked to the area grid)
Definition oo.qh:67
void generic_plat_blocked(entity this, entity blocker)
Definition platforms.qc:3
float dmgtime
Definition platforms.qh:7
float dmgtime2
Definition platforms.qh:8
#define setthink(e, f)
#define setblocked(e, f)
const int CH_TRIGGER_SINGLE
Definition sound.qh:13
const float VOL_BASE
Definition sound.qh:36
const float ATTEN_IDLE
Definition sound.qh:32
void soundto(int _dest, entity e, int chan, string samp, float vol, float _atten, float _pitch)
Definition all.qc:74
bool InitMovingBrushTrigger(entity this)
Definition subs.qc:577
void SUB_NullThink(entity this)
Definition subs.qc:3
vector destvec
Definition subs.qh:35
string noise
Definition subs.qh:83
string message2
Definition triggers.qh:19

References active, ACTIVE_ACTIVE, ATTEN_IDLE, CH_TRIGGER_SINGLE, cnt, destvec, dmg, dmgtime, dmgtime2, EF_LOWPRECISION, effects, entity(), func_fourier_controller_think(), generic_plat_blocked(), height, InitMovingBrushTrigger(), ltime, message, message2, MSG_INIT, netname, new_pure, nextthink, noise, origin, precache_sound(), setblocked, setthink, soundto(), speed, SUB_NullThink(), time, and VOL_BASE.