from eventAPI import *
from APIUtils import *
from SDLKeys import *

def fireEvent(e):
    PltF1=getTag(e,"PltF1");
    if not (PltF1&0x02):
        return 1;

    showMessage(e,
                ["If you're not with us, you're against us! It looks like we'll just have to convince you our cause is just, the HARD way!"]);
    combatRet = combat(e,[("Townie",10,10,10)]);
    if combatRet==1:
        townieCount=getTag(e,"townieCount");
        townieCount+=1;
        setTag(e,"townieCount",townieCount);
        if townieCount>=10:
            GuardPlt1=getTag(e,"GuardPlt1");
            GuardPlt1|=0x02;
            setTag(e,"GuardPlt1",GuardPlt1);
            YeodPlt1=getTag(e,"YeodPlt");
            setTag(e,"YeodPlt",YeodPlt1|0x01);
            showMessage(e,
                        ["A note is placed in your hand..."]);
            giveItems(e, ["Guards' Note"])
            return 1;

    return 1;

