Exemplo n.º 1
0
def func(self: Event, mainActor: Contestant, state, participants: Optional[List[Contestant]], victims: List[Contestant], sponsors: Optional[List[Contestant]]=None):
    probKill = Event.DieOrEscapeProb1v1(mainActor, victims[0], state["settings"], defenseStat=(
        victims[0].getCombatAbility(mainActor) * 0.75 + victims[0].stats['cleverness'] * 0.25))
    spearBroken = random.randint(0, 1)
    tempList = [mainActor, state["items"]["Spear"], victims[0]]
    # Deteriorate relationship of victim toward participant
    state["allRelationships"].IncreaseFriendLevel(victims[0], mainActor, -2)
    state["allRelationships"].IncreaseLoveLevel(victims[0], mainActor, -3)
    lootDict = None
    destroyedList = None
    if random.random() < probKill:
        victims[0].kill()
        deadList = [victims[0].name]
        desc = mainActor.name + ' threw a spear through ' + \
            victims[0].name + "'s neck and killed " + \
            Event.parseGenderObject(victims[0]) + "."
        lootDict, destroyedList = self.lootForOne(mainActor, victims[0])
    else:
        deadList = []
        desc = mainActor.name + ' threw a spear at ' + \
            victims[0].name + ", but missed."
        # 50/50 chance the victim gets the spear, if not broken.
        if not spearBroken and random.randint(0, 1):
            desc += " " + victims[0].name + " was able to steal the spear!"
            lootref = mainActor.removeAndGet(state["items"]["Spear"])
            victims[0].addItem(lootref)
            lootDict = {victims[0].name: [lootref]}
    if spearBroken:
        desc += " The spear was broken in the process."
        mainActor.removeItem(state["items"]["Spear"])
    # Second entry is the contestants or items named in desc, in desired display. Third is anyone who died. This is in strings.
    return EventOutput(desc, tempList, deadList, loot_table=lootDict, destroyed_loot_table=destroyedList)
Exemplo n.º 2
0
def func(self,
         mainActor,
         state=None,
         participants=None,
         victims=None,
         sponsors=None):
    probKill = Event.DieOrEscapeProb1v1(
        mainActor,
        victims[0],
        state["settings"],
        defenseStat=(victims[0].getCombatAbility(mainActor) * 0.25 +
                     victims[0].stats['cleverness'] * 0.15))
    tempList = [mainActor, state["items"]["Bow and Arrow"], victims[0]]
    # Deteriorate relationship of victim toward participant
    state["allRelationships"].IncreaseFriendLevel(victims[0], mainActor, -2)
    state["allRelationships"].IncreaseLoveLevel(victims[0], mainActor, -3)
    lootDict = None
    destroyedList = None
    if random.random() < probKill:
        victims[0].kill()
        deadList = [victims[0].name]
        desc = mainActor.name + ' shot an arrow at ' + \
            victims[0].name + " and killed " + \
            Event.parseGenderObject(victims[0]) + "."
        lootDict, destroyedList = self.lootForOne(mainActor, victims[0])
    else:
        deadList = []
        desc = mainActor.name + ' shot an arrow at ' + \
            victims[0].name + ", but missed."
    # Second entry is the contestants or items named in desc, in desired display. Third is anyone who died. This is in strings.
    return EventOutput(desc,
                       tempList,
                       deadList,
                       loot_table=lootDict,
                       destroyed_loot_table=destroyedList)
Exemplo n.º 3
0
def func(self,
         mainActor,
         state=None,
         participants=None,
         victims=None,
         sponsors=None):
    probKill = Event.DieOrEscapeProb1v1(
        mainActor,
        victims[0],
        state["settings"],
        defenseStat=(victims[0].getCombatAbility(mainActor) * 0.15 +
                     victims[0].stats['cleverness'] * 0.10))
    tempList = [mainActor, state["items"]["Rifle"], victims[0]]
    # Deteriorate relationship of victim toward participant
    state["allRelationships"].IncreaseFriendLevel(victims[0], mainActor, -2)
    state["allRelationships"].IncreaseLoveLevel(victims[0], mainActor, -3)
    # RNG ammo use, this is unique to the rifle.
    actualItem = mainActor.hasThing("Rifle")[0]
    currentAmmo = actualItem.data.get("currentammo",
                                      actualItem.rawData["ammo"])
    ammoUsed = min(
        random.randint(actualItem.rawData["ammouse"][0],
                       actualItem.rawData["ammouse"][1]), currentAmmo)
    currentAmmo -= ammoUsed
    lootDict = None
    destroyedList = None
    if random.random() < probKill:
        victims[0].kill()
        deadList = [victims[0].name]
        desc = mainActor.name + ' fired at ' + \
            victims[0].name + " from long range and killed " + \
            Event.parseGenderObject(victims[0]) + "."
        lootDict, destroyedList = self.lootForOne(mainActor, victims[0])
    else:
        deadList = []
        desc = mainActor.name + ' fired at ' + \
            victims[0].name + " from long range, but missed."
    if currentAmmo > 0:
        desc += "\nAmmo remaining: " + str(currentAmmo) + " (" + str(
            ammoUsed) + " used)"
        actualItem.data["currentammo"] = currentAmmo
    else:
        desc += "\nThe Rifle belonging to " + mainActor.name + " exhausted its ammo."
        mainActor.removeItem("Rifle")
    # Second entry is the contestants or items named in desc, in desired display. Third is anyone who died. This is in strings.
    return EventOutput(desc,
                       tempList,
                       deadList,
                       loot_table=lootDict,
                       destroyed_loot_table=destroyedList)
Exemplo n.º 4
0
def func(self,
         mainActor,
         state=None,
         participants=None,
         victims=None,
         sponsors=None):
    probSurvival = (1 - Event.DieOrEscapeProb1v1(
        mainActor,
        victims[0],
        state["settings"],
        defenseStat=(victims[0].getCombatAbility(mainActor) * 0.75 +
                     victims[0].stats['cleverness'] * 0.25))
                    ) * 0.5  # This event is rigged against defender
    tempList = [mainActor, state["items"]["MolotovCocktail"], victims[0]]
    state["allRelationships"].IncreaseFriendLevel(victims[0], mainActor, -4)
    state["allRelationships"].IncreaseLoveLevel(victims[0], mainActor, -6)
    if random.random() < probSurvival:
        desc = mainActor.name + ' threw a molotov cocktail at ' + \
            victims[0].name + " but " + \
            Event.parseGenderSubject(victims[0]) + " escaped!"
        return (desc, tempList, [])
    else:
        victims[0].kill()
        desc = mainActor.name + ' threw a molotov cocktail at ' + \
            victims[0].name + " and burned " + \
            Event.parseGenderObject(victims[0]) + " alive."
        mainActor.permStatChange({'stability': -2})
        if mainActor.stats["stability"] < 3:
            desc += " " + mainActor.name + " laughed at " + \
                Event.parseGenderPossessive(victims[0]) + " agony."
        mainActor.removeItem(state["items"]["MolotovCocktail"])
        lootDict, destroyedList = self.lootForOne(mainActor, victims[0])
        if victims[0].removeStatus(state["statuses"]["Hypothermia"]):
            desc += " " + victims[0].name + " is no longer hypothermic."
        # Second entry is the contestants or items named in desc, in desired display. Third is anyone who died. This is in strings.
        return EventOutput(desc,
                           tempList, [victims[0].name],
                           loot_table=lootDict,
                           destroyed_loot_table=destroyedList)
Exemplo n.º 5
0
def func(self,
         mainActor,
         state=None,
         participants=None,
         victims=None,
         sponsors=None):
    # Deteriorate relationship of victim toward participant
    state["allRelationships"].IncreaseFriendLevel(victims[0], mainActor, -2)
    state["allRelationships"].IncreaseLoveLevel(victims[0], mainActor, -3)
    probKill = Event.DieOrEscapeProb1v1(
        mainActor,
        victims[0],
        state["settings"],
        defenseStat=(victims[0].getCombatAbility(mainActor) * 0.5 +
                     victims[0].stats['cleverness']
                     ))  # this event is mildly rigged against attacker
    descList = [mainActor, victims[0]]
    if random.random() < probKill:
        victims[0].kill()
        if mainActor.stats['ruthlessness'] > 6:
            desc = mainActor.name + ' lay in wait for ' + \
                victims[0].name + ', surprising and gutting ' + \
                Event.parseGenderObject(victims[0]) + '.'
        else:
            desc = mainActor.name + ' lay in wait for ' + \
                victims[0].name + ', surprising and killing ' + \
                Event.parseGenderObject(victims[0]) + '.'
        lootDict, destroyedList = self.lootForOne(mainActor, victims[0])
        return EventOutput(desc,
                           descList, [victims[0].name],
                           loot_table=lootDict,
                           destroyed_loot_table=destroyedList)
    else:
        desc = mainActor.name + ' lay in wait for ' + \
            victims[0].name + ', but ' + \
            Event.parseGenderSubject(victims[0]) + ' managed to see it coming.'
        # Second entry is the contestants or items named in desc, in desired display. Third is anyone who died. This is in strings.
        return (desc, descList, [])