Ejemplo n.º 1
0
def DefensiveStanceRadial(attachee, args, evt_obj):
    isAdded = attachee.condition_add_with_args(
        "Defensive Stance", 0,
        0)  # adds the "Defensive Stance" condition on first radial menu build
    isWinded = 0
    isActive = 0
    # add radial menu action Defensive Stanch
    if not isAdded:  # means it's not a newly added condition
        isWinded = attachee.d20_query("Defensive Stance Is Winded")
        isActive = attachee.d20_query("Defensive Stance Is Active")
    #print "is active: " + str(isActive) + "  is winded: " + str(isWinded)
    if isActive and (
            isWinded == 0
    ):  # if already active, show the "Winded" option a la Barbarian Rage
        radialAction = tpdp.RadialMenuEntryPythonAction(
            -1, D20A_PYTHON_ACTION, defensiveStanceWindedEnum, 0,
            "TAG_INTERFACE_HELP")
    else:
        #print str(D20A_PYTHON_ACTION) + "  " + str(defensiveStanceEnum)
        radialAction = tpdp.RadialMenuEntryPythonAction(
            -1, D20A_PYTHON_ACTION, defensiveStanceEnum, 0,
            "TAG_INTERFACE_HELP")
    radialAction.add_child_to_standard(attachee,
                                       tpdp.RadialMenuStandardNode.Class)
    return 0
def Bag_Of_Holding_OnBuildRadialMenuEntry(attachee, args, evt_obj):
	radial_parent = tpdp.RadialMenuEntryParent("Bag of Holding")
	radial_parent_id = radial_parent.add_child_to_standard(attachee, tpdp.RadialMenuStandardNode.Items)

	radial_action = tpdp.RadialMenuEntryPythonAction("Inventory", toee.D20A_PYTHON_ACTION, 3006, 0, "TAG_INTERFACE_HELP")
	#assert isinstance(radial_action, tpdp.RadialMenuEntryParent)
	radial_action.add_as_child(attachee, radial_parent_id)
	#radial_action.add_child_to_standard(attachee, tpdp.RadialMenuStandardNode.Items)

	radial_action = tpdp.RadialMenuEntryPythonAction("Examine bodies", toee.D20A_PYTHON_ACTION, 3007, 0, "TAG_INTERFACE_HELP")
	#assert isinstance(radial_action, tpdp.RadialMenuEntryParent)
	#radial_action.add_child_to_standard(attachee, tpdp.RadialMenuStandardNode.Items)
	radial_action.add_as_child(attachee, radial_parent_id)

	radial_action = tpdp.RadialMenuEntryPythonAction("Transfer from bodies", toee.D20A_PYTHON_ACTION, 3008, 0, "TAG_INTERFACE_HELP")
	#assert isinstance(radial_action, tpdp.RadialMenuEntryParent)
	#radial_action.add_child_to_standard(attachee, tpdp.RadialMenuStandardNode.Items)
	radial_action.add_as_child(attachee, radial_parent_id)

	radial_action = tpdp.RadialMenuEntryPythonAction("List contents", toee.D20A_PYTHON_ACTION, 3009, 0, "TAG_INTERFACE_HELP")
	#assert isinstance(radial_action, tpdp.RadialMenuEntryParent)
	#radial_action.add_child_to_standard(attachee, tpdp.RadialMenuStandardNode.Items)
	radial_action.add_as_child(attachee, radial_parent_id)

	if (0):
		radial_action = tpdp.RadialMenuEntryPythonAction("Autosell", toee.D20A_PYTHON_ACTION, 3013, 0, "TAG_INTERFACE_HELP")
		#assert isinstance(radial_action, tpdp.RadialMenuEntryParent)
		#radial_action.add_child_to_standard(attachee, tpdp.RadialMenuStandardNode.Items)
		radial_action.add_as_child(attachee, radial_parent_id)
	return 0
Ejemplo n.º 3
0
def VersatileUnarmedStrikeRadial(attachee, args, evt_obj):

	isAdded = attachee.condition_add_with_args("Versatile Unarmed Strike",0,0) # adds the "Wolverine Rage" condition on first radial menu build
	
	radial_parent = tpdp.RadialMenuEntryParent("Versatile Unarmed Strike")
	VersatileUnarmedStrikeId = radial_parent.add_child_to_standard(attachee, tpdp.RadialMenuStandardNode.Feats)
	
	#0 - Bludgeoning, 1 - Piercing, 2 - Slashing
	radialAction = tpdp.RadialMenuEntryPythonAction("Bludgeoning", D20A_PYTHON_ACTION, VersatileUnarmedStrikeBludgeoningEnum, 0, "TAG_INTERFACE_HELP")
	radialAction.add_as_child(attachee, VersatileUnarmedStrikeId)
	radialAction = tpdp.RadialMenuEntryPythonAction("Piercing", D20A_PYTHON_ACTION, VersatileUnarmedStrikePiercingEnum, 1, "TAG_INTERFACE_HELP")
	radialAction.add_as_child(attachee, VersatileUnarmedStrikeId)
	radialAction = tpdp.RadialMenuEntryPythonAction("Slashing", D20A_PYTHON_ACTION, VersatileUnarmedStrikeSlashingEnum, 2, "TAG_INTERFACE_HELP")
	radialAction.add_as_child(attachee, VersatileUnarmedStrikeId)
	
	return 0
Ejemplo n.º 4
0
def AssassinDeathAttackRadial(attachee, args, evt_obj):
    radial_action = tpdp.RadialMenuEntryPythonAction("Study Target",
                                                     D20A_PYTHON_ACTION,
                                                     deathAttackStudyEnum, 0,
                                                     "TAG_INTERFACE_HELP")
    spell_data = tpdp.D20SpellData(3210)
    ass_lvl = attachee.stat_level_get(classEnum)
    spell_data.set_spell_level(ass_lvl)
    radial_action.set_spell_data(spell_data)
    radial_action.add_child_to_standard(attachee,
                                        tpdp.RadialMenuStandardNode.Class)
    #print "Death attack radial"
    if attachee.d20_query("Has Studied Target"):
        #print "Has studied target (radial)"
        radial_parent = tpdp.RadialMenuEntryParent("Death Attack")
        #print "Created radial parent"
        par_node_id = radial_parent.add_child_to_standard(
            attachee, tpdp.RadialMenuStandardNode.Class)
        #print "Added radial parent, ID " + str(par_node_id)
        check_box_paralyze = tpdp.RadialMenuEntryToggle(
            "Paralyze", "TAG_INTERFACE_HELP")
        check_box_paralyze.link_to_args(args, 1)
        check_box_paralyze.add_as_child(attachee, par_node_id)

    return 0
Ejemplo n.º 5
0
def exEntangled_OnBuildRadialMenuEntry(attachee, args, evt_obj):
    radial_action = tpdp.RadialMenuEntryPythonAction("Break Free",
                                                     D20A_PYTHON_ACTION, 6101,
                                                     0, "TAG_INTERFACE_HELP")
    radial_action.add_child_to_standard(attachee,
                                        tpdp.RadialMenuStandardNode.Skills)
    return 0
Ejemplo n.º 6
0
def ImpromptuSneakAttack(attachee, args, evt_obj):
	attachee.condition_add_with_args("Impromptu Sneak Attack",0,0)
	arcTrkLvl = attachee.stat_level_get(classEnum)
	if arcTrkLvl - 3 < 0:
		return 0
	radialAction = tpdp.RadialMenuEntryPythonAction(-1, D20A_PYTHON_ACTION, impromptuSneakEnum, 0,
													"TAG_INTERFACE_HELP")
	radialAction.add_child_to_standard(attachee, tpdp.RadialMenuStandardNode.Class)
	return 0
Ejemplo n.º 7
0
def Break_Object_OnBuildRadialMenuEntry(attachee, args, evt_obj):
    radial_action = tpdp.RadialMenuEntryPythonAction("Break an Object",
                                                     toee.D20A_PYTHON_ACTION,
                                                     3012, 0,
                                                     "TAG_INTERFACE_HELP")
    #assert isinstance(radial_action, tpdp.RadialMenuEntryParent)
    radial_action.add_child_to_standard(attachee,
                                        tpdp.RadialMenuStandardNode.Skills)
    return 0
Ejemplo n.º 8
0
def SmiteGoodRadial(attachee, args, evt_obj):
    timesPerDay = args.get_arg(0)
    if timesPerDay <= 0:
        return 0
    radial_action = tpdp.RadialMenuEntryPythonAction(
        "Smite Good", D20A_PYTHON_ACTION, smiteGoodEnum, 0,
        "TAG_BLACKGUARDS")  # TODO add help entry
    radial_action.add_child_to_standard(attachee,
                                        tpdp.RadialMenuStandardNode.Class)
    return 0
Ejemplo n.º 9
0
def DivineArmorRadial(attachee, args, evt_obj):
    isAdded = attachee.condition_add_with_args(
        "Divine Armor Effect", 0,
        0)  # adds the "Divine Armor" condition on first radial menu build
    radialAction = tpdp.RadialMenuEntryPythonAction(-1, D20A_PYTHON_ACTION,
                                                    divineArmorEnum, 0,
                                                    "TAG_INTERFACE_HELP")
    radialAction.add_child_to_standard(attachee,
                                       tpdp.RadialMenuStandardNode.Feats)
    return 0
Ejemplo n.º 10
0
def netted_OnBuildRadialMenuEntry(attachee, args, evt_obj):
	#int __cdecl WebBreakfreeRadial(DCA args)
	assert isinstance(attachee, toee.PyObjHandle)
	assert isinstance(args, tpdp.EventArgs)
	possible = attachee.d20_query(toee.Q_Is_BreakFree_Possible)
	if (not possible): return 0

	radial_action = tpdp.RadialMenuEntryPythonAction(5061, toee.D20A_BREAK_FREE, 0, 0, "TAG_RADIAL_MENU_BREAK_FREE")
	radial_action.add_child_to_standard(attachee, tpdp.RadialMenuStandardNode.Movement)
	return 0
Ejemplo n.º 11
0
def Inspect_OnBuildRadialMenuEntry(attachee, args, evt_obj):
    radial_action = tpdp.RadialMenuEntryPythonAction("Inspect",
                                                     toee.D20A_PYTHON_ACTION,
                                                     3005, 0,
                                                     "TAG_INTERFACE_HELP")
    #assert isinstance(radial_action, tpdp.RadialMenuEntryParent)
    spell_data = tpdp.D20SpellData(3210)
    spell_data.set_spell_level(1)
    radial_action.set_spell_data(spell_data)
    radial_action.add_child_to_standard(attachee,
                                        tpdp.RadialMenuStandardNode.Skills)
    return 0
Ejemplo n.º 12
0
def DeathArrowRadial(attachee, args, evt_obj):
    if not has_ranged_weapon(attachee):
        return 0
    if args.get_arg(0):
        return 0
    radial_action = tpdp.RadialMenuEntryPythonAction("Arrow of Death",
                                                     D20A_PYTHON_ACTION,
                                                     deathArrowEnum, 0,
                                                     "TAG_INTERFACE_HELP")
    radial_action.add_child_to_standard(attachee,
                                        tpdp.RadialMenuStandardNode.Class)

    return 0
Ejemplo n.º 13
0
def AbjurantChampionArcaneBoostRadial(attachee, args, evt_obj):
    radialParent = tpdp.RadialMenuEntryParent("Arcane Boost")
    arcaneBoostID = radialParent.add_child_to_standard(
        attachee, tpdp.RadialMenuStandardNode.Class)

    #Iterate over all effect types ()
    for effectType in range(1, 10):
        effectName = GetArcaneBoostDescription(effectType)

        #Add the effect to the arcane boost id menu
        effectNode = tpdp.RadialMenuEntryParent(effectName)
        effectID = effectNode.add_as_child(attachee, arcaneBoostID)

        # create the spell level nodes (level must be greater than 1)
        spell_level_ids = []

        #Add the name for the arcane boost effect type sub menu
        for p in range(1, 10):
            spell_level_node = tpdp.RadialMenuEntryParent(str(p))
            spell_level_ids.append(
                spell_level_node.add_as_child(attachee, effectID))

        known_spells = attachee.spells_known

        for knSp in known_spells:
            if knSp.is_naturally_cast() and (knSp.spell_level > 0):
                spell_node = tpdp.RadialMenuEntryPythonAction(
                    knSp, D20A_PYTHON_ACTION, arcaneBoostEnum, effectType)
                spell_node.add_as_child(attachee,
                                        spell_level_ids[knSp.spell_level - 1])

        mem_spells = attachee.spells_memorized
        for memSp in mem_spells:
            if (not memSp.is_used_up()) and (memSp.spell_level > 0):
                spell_node = tpdp.RadialMenuEntryPythonAction(
                    memSp, D20A_PYTHON_ACTION, arcaneBoostEnum, effectType)
                spell_node.add_as_child(attachee,
                                        spell_level_ids[memSp.spell_level - 1])
    return 0
Ejemplo n.º 14
0
def ImbueArrowRadial(attachee, args, evt_obj):

    weap = attachee.item_worn_at(3)
    if not is_ranged_weapon(weap):
        weap = attachee.item_worn_at(4)
        if not is_ranged_weapon(weap):
            return 0

    known_spells = attachee.spells_known

    radial_parent = tpdp.RadialMenuEntryParent("Imbue Arrow")
    imb_arrow_id = radial_parent.add_child_to_standard(
        attachee, tpdp.RadialMenuStandardNode.Class)

    # create the spell level nodes
    spell_level_ids = []
    for p in range(0, 10):
        spell_level_node = tpdp.RadialMenuEntryParent(str(p))
        spell_level_ids.append(
            spell_level_node.add_as_child(attachee, imb_arrow_id))

    for knSp in known_spells:
        if knSp.is_naturally_cast() and ImbueOk(attachee, knSp):
            spell_node = tpdp.RadialMenuEntryPythonAction(
                knSp, D20A_PYTHON_ACTION, imbueArrowEnum, 0)
            spell_node.add_as_child(attachee,
                                    spell_level_ids[knSp.spell_level])

    mem_spells = attachee.spells_memorized
    for memSp in mem_spells:
        if (not memSp.is_used_up()) and ImbueOk(attachee, memSp):
            spell_node = tpdp.RadialMenuEntryPythonAction(
                memSp, D20A_PYTHON_ACTION, imbueArrowEnum, 0)
            spell_node.add_as_child(attachee,
                                    spell_level_ids[memSp.spell_level])
    return 0
Ejemplo n.º 15
0
def HailOfArrowsRadial(attachee, args, evt_obj):
    if not has_ranged_weapon(attachee):
        return 0
    if args.get_arg(0):
        return 0

    radial_action = tpdp.RadialMenuEntryPythonAction("Hail of Arrows",
                                                     D20A_PYTHON_ACTION,
                                                     hailOfArrowsEnum, 0,
                                                     "TAG_INTERFACE_HELP")
    spell_data = tpdp.D20SpellData(3180)
    aarc_lvl = attachee.stat_level_get(classEnum)
    spell_data.set_spell_class(classEnum)
    spell_data.set_spell_level(aarc_lvl)
    radial_action.set_spell_data(spell_data)
    radial_action.add_child_to_standard(attachee,
                                        tpdp.RadialMenuStandardNode.Class)

    return 0
def Armor_Blurring_OnBuildRadialMenuEntry(attachee, args, evt_obj):
    assert isinstance(attachee, toee.PyObjHandle)
    assert isinstance(args, tpdp.EventArgs)
    # evt_obj is None

    if (args.get_arg(1)):
        # skip when active
        return 0

    #if (args.get_arg(4) >= 3): # used of 3 per day
    #	print("args.get_arg(4): {}".format(args.get_arg(4)))
    #	# skip when used
    #	return 0

    used = args.get_arg(4)
    text = "Armor"
    item_wear = args.get_arg(0)
    if (item_wear):
        worn_item = attachee.item_worn_at(item_wear)
        if (worn_item):
            text = worn_item.description
    parent_item = tpdp.RadialMenuEntryParent(text)
    parent_item_id = parent_item.add_child_to_standard(
        attachee, tpdp.RadialMenuStandardNode.Items)

    left_usage = 3 - used
    text = "Activate Blurring {} / {}".format(left_usage, 3)

    radial_action = tpdp.RadialMenuEntryPythonAction(text,
                                                     toee.D20A_PYTHON_ACTION,
                                                     3020, toee.spell_blur,
                                                     "TAG_INTERFACE_HELP")
    #assert isinstance(radial_action, tpdp.RadialMenuEntryParent)
    spell_data = tpdp.D20SpellData(toee.spell_blur)
    spell_data.set_spell_level(5)
    radial_action.set_spell_data(spell_data)
    #radial_action.add_child_to_standard(attachee, tpdp.RadialMenuStandardNode.Items)
    radial_action.add_as_child(attachee, parent_item_id)
    return 0
Ejemplo n.º 17
0
def Lodged_Quills_OnBuildRadialMenuEntry(attachee, args, evt_obj):
	radial_action = tpdp.RadialMenuEntryPythonAction("Remove Quills", toee.D20A_PYTHON_ACTION, 3004, 0, "TAG_INTERFACE_HELP")
	#assert isinstance(radial_action, tpdp.RadialMenuEntryParent)
	radial_action.add_child_to_standard(attachee, tpdp.RadialMenuStandardNode.Skills)
	return 0
Ejemplo n.º 18
0
def Net_Throw_OnBuildRadialMenuEntry(attachee, args, evt_obj):
	radial_action = tpdp.RadialMenuEntryPythonAction("Net Throw", toee.D20A_PYTHON_ACTION, 3014, 0, "TAG_INTERFACE_HELP")
	radial_action.add_child_to_standard(attachee, tpdp.RadialMenuStandardNode.Offense)
	return 0