corpse FragmentShader(VertexOut vertex, Field <data> Select, Field <corpse> Corpses) { data select = Select[Here]; corpse here = Corpses[Here]; if (Something(select)) { here = corpse.Nothing; } return(here); }
protected color Sprite(corpse c, vec2 pos, PointSampler Texture) { if (pos.x > 1 || pos.y > 1 || pos.x < 0 || pos.y < 0) { return(color.TransparentBlack); } pos.x += Float(Anim.Dead); pos.y += Float(c.direction) - 1; pos *= UnitSpriteSheet.SpriteSize; var clr = Texture[pos]; return(clr); }
color FragmentShader(VertexOut vertex, Field <corpse> Corpses, PointSampler Texture, float blend) { color output = color.TransparentBlack; corpse here = Corpses[Here]; vec2 subcell_pos = get_subcell_pos(vertex, Corpses.Size); if (CorpsePresent(here)) { output += Sprite(here, subcell_pos, Texture); output *= blend; } return(output); }
magic FragmentShader(VertexOut vertex, Field <magic> Magic, Field <data> CurrentData, Field <data> PreviousData, Field <corpse> Corpses, Field <PlayerTuple> Necromancy) { magic here = Magic[Here]; corpse corpse_here = Corpses[Here]; PlayerTuple necromancy = Necromancy[Here]; data cur_data = CurrentData[Here], prev_data = PreviousData[Here]; // Reset the kill bit here.kill = _false; here.raising_player = Player.None; // Check for resurrection if (CorpsePresent(corpse_here) && !Something(cur_data) && !Something(prev_data)) { float player = Player.None; float necro = _0; if (necromancy.PlayerOne > necro) { necro = necromancy.PlayerOne; player = Player.One; } if (necromancy.PlayerTwo > necro) { necro = necromancy.PlayerTwo; player = Player.Two; } if (necromancy.PlayerThree > necro) { necro = necromancy.PlayerThree; player = Player.Three; } if (necromancy.PlayerFour > necro) { necro = necromancy.PlayerFour; player = Player.Four; } here.raising_player = player; } return(here); }
corpse FragmentShader(VertexOut vertex, Field <unit> Unit, Field <data> Data, Field <corpse> Corpses, Field <magic> Magic) { unit unit_here = Unit[Here]; data data_here = Data[Here]; corpse corpse_here = Corpses[Here]; magic magic_here = Magic[Here]; // Removed corpses that are being raised. if (magic_here.raising_player != Player.None && unit_here.anim == Anim.StartRaise) { corpse_here = corpse.Nothing; } if (Something(data_here) && unit_here.anim == Anim.Die && LeavesCorpse(unit_here)) { corpse_here.direction = data_here.direction; corpse_here.type = unit_here.type; corpse_here.player = unit_here.player; } return(corpse_here); }
protected static bool CorpsePresent(corpse u) { return(u.direction > 0); }