[Add] More verbose ai logging and more monies.

This commit is contained in:
Allanis 2013-03-16 22:41:24 +00:00
parent b05b50684a
commit 910eb656a5
4 changed files with 14 additions and 1 deletions

View File

@ -27,6 +27,9 @@ function attacked(attacker)
end end
end end
function create()
end
function attack() function attack()
target = ai.targetid() target = ai.targetid()

View File

@ -33,6 +33,9 @@ function attacked(attacker)
end end
function create() function create()
if ai.rnd(0,2)==0 then -- More money, but less often.
ai.setcredits(1000, ai.shipprice()/70)
end
if ai.rnd(0,2)==0 then if ai.rnd(0,2)==0 then
ai.broadcast("The Empire is watching") ai.broadcast("The Empire is watching")
end end

View File

@ -56,6 +56,12 @@ function attacked(attacker)
end end
end end
function create()
if ai.rnd(0,5) ~= 0 then
ai.setcredits(0, ai.shipprice()/300)
end
end
function taunt(target) function taunt(target)
num = ai.rnd(0,4) num = ai.rnd(0,4)
if num == 0 then msg = "How dare you attack me?!" if num == 0 then msg = "How dare you attack me?!"

View File

@ -215,7 +215,8 @@ static void ai_run(const char* funcname) {
lua_getglobal(L, funcname); lua_getglobal(L, funcname);
if(lua_pcall(L, 0, 0, 0)) if(lua_pcall(L, 0, 0, 0))
// Errors accured. // Errors accured.
WARN("%s", lua_tostring(L, -1)); WARN("Pilot '%s' ai -> '%s' : %s",
cur_pilot->name, funcname, lua_tostring(L,-1));
} }
// Destroy the AI part of the pilot. // Destroy the AI part of the pilot.