Skip to content

Instantly share code, notes, and snippets.

View ennorehling's full-sized avatar

Enno Rehling ennorehling

View GitHub Profile

Beispiel: Ich befehle meiner Einheit:

EINHEIT demo
UNTERHALTE
@GIB xol 200 Silber
GIB phy 100 Silber

die Befehle wereden ausgeführt, und in der Zugvorlage steht:

EINHEIT demo
@ennorehling
ennorehling / defaults.md
Created July 20, 2022 06:02
Vorausbefehle

Ich habe natuerlich immer noch Fragen und Sonderfaelle Enno —

Mal ganz vorne anfangen.

Wenn in meiner Vorlage steht:

ARBEITE
// TODO: Kekse

und ich befehle diese Woche:

#include "util/pofile.h"
#include "util/strings.h"
#include <stb_ds.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
typedef struct keyval_t {
function test_leave_harbour()
local f = faction.create('human')
local r1 = region.create(1, 0, 'ocean')
local r2 = region.create(-1, 0, 'ocean')
local r = region.create(0, 0, 'glacier')
local b = building.create(r, 'harbour', 25)
local sh = ship.create(r1, 'longboat')
local u = unit.create(f, r1, 1)
local u2 = unit.create(f, r, 1)
u2.building = b
/**
* `n` persons with skill `sn` are merged into `add` persons with skill `sv`
*/
int merge_skill(const skill* sv, const skill* sn, skill* result, int n, int add)
{
int total = add + n;
/* number of person-weeks the units have already studied: */
int days, weeks = weeks_from_level(sn ? sn->level : 0) * n
+ weeks_from_level(sv ? sv->level : 0) * add;
function test_give_person_first()
local r = region.create(0, 0, "plain")
local f = faction.create('human')
local u1 = unit.create(f, r, 1)
local u2 = unit.create(f, r, 1)
local u3 = unit.create(f, r, 1)
u3:add_item('sword', 10)
u3:add_order("GIB " .. itoa36(u2.id) .. " ALLES PERSON")
u3:add_order("GIB " .. itoa36(u2.id) .. " ALLES")