share/hedgewars/Data/Scripts/Achievements.lua
author nemo
Wed, 02 Jan 2019 11:08:26 -0500
changeset 14516 3e6b12d23957
parent 14236 74bf2d906097
permissions -rw-r--r--
heh. apparently pas2c doesn't validate pascal, so I guess we need to dogfood *both*

HedgewarsScriptLoad("/Scripts/Locale.lua")

function awardAchievement(name, statMessage, capgrp)
	local achievementString = string.format(loc("Achievement gotten: %s"), name)
	if capgrp == nil then
		capgrp = capgrpMessage2
	end
	if capgrp ~= false then
		AddCaption(achievementString, 0xFFBA00FF, capgrp)
	end
	if not statMessage then
		statMessage = achievementString
	end
	SendStat(siCustomAchievement, statMessage)
end