diff --git a/scripts/ai/collective.lua b/scripts/ai/collective.lua index 0071749..62db9ae 100644 --- a/scripts/ai/collective.lua +++ b/scripts/ai/collective.lua @@ -27,6 +27,9 @@ function attacked(attacker) end end +function create() +end + function attack() target = ai.targetid() diff --git a/scripts/ai/empire.lua b/scripts/ai/empire.lua index 585bdc4..a74c5f6 100644 --- a/scripts/ai/empire.lua +++ b/scripts/ai/empire.lua @@ -33,6 +33,9 @@ function attacked(attacker) end 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 ai.broadcast("The Empire is watching") end diff --git a/scripts/ai/pirate.lua b/scripts/ai/pirate.lua index b329a09..f3af2bb 100644 --- a/scripts/ai/pirate.lua +++ b/scripts/ai/pirate.lua @@ -56,6 +56,12 @@ function attacked(attacker) end end +function create() + if ai.rnd(0,5) ~= 0 then + ai.setcredits(0, ai.shipprice()/300) + end +end + function taunt(target) num = ai.rnd(0,4) if num == 0 then msg = "How dare you attack me?!" diff --git a/src/ai.c b/src/ai.c index 1b0fb69..a013c82 100644 --- a/src/ai.c +++ b/src/ai.c @@ -215,7 +215,8 @@ static void ai_run(const char* funcname) { lua_getglobal(L, funcname); if(lua_pcall(L, 0, 0, 0)) // 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.