Example #1
0
void RetinueThink(struct Retinue* _Retinue) {
	if(NEWYEAR(g_GameWorld.Date) != 0) {
		RetinuePayWarriors(_Retinue);		
	}
	if(_Retinue->IsRecruiting != 0) {
		struct Settlement* _Home = PersonHome(_Retinue->Leader->Person);
		if(_Home->FreeWarriors.Size <= 0)
			goto not_recruit;
		if(BigGuySkillCheck(_Retinue->Leader, BGSKILL_CHARISMA, SKILLCHECK_DEFAULT) == 0)
			goto not_recruit;
		RetinueAddWarrior(_Retinue, _Home->FreeWarriors.Front->Data);
		LnkLstPopFront(&_Home->FreeWarriors);	
	}
	not_recruit:
	return;
}
Example #2
0
int PlotWarScore(struct Plot* _Plot, const struct LinkedList* _GuyList, struct PlotAction** _Actions, int16_t* _Threat) {
	int _Score = 0;

	for(const struct LnkLst_Node* _Itr = _GuyList->Front; _Itr != NULL; _Itr = _Itr->Next) {
		const struct BigGuy* _Guy = _Itr->Data;
		struct PlotAction* _Action = NULL;

		for(_Action = *_Actions; _Action != NULL; _Action = _Action->Next) {
			if(_Action->Actor != _Guy)
				continue;
			++(*_Threat);
			goto found_action;
		}
		PlotAddAction(_Plot, PLOTACT_ATTACK, _Guy, NULL);
		PLOT_CURRACTLIST(_Plot)->Flags |= BigGuySkillCheck(_Guy, BGSKILL_WIT, SKILLCHECK_DEFAULT);
		_Action = PLOT_CURRACTLIST(_Plot);
		found_action:
		PlotPerformAction(_Action, _Plot);
		_Score += ActionDamage(_Action);
		continue;
	}
	return _Score;
}