コード例 #1
0
def MomentOfPrescienceRadial(attachee, args, evt_obj):
	spell_id = args.get_arg(0)
	spell_packet = tpdp.SpellPacket(spell_id)
	bonus = min(spell_packet.caster_level, 25)
	bonusString = "+" + str(bonus)

	#Add the top level menu
	radial_parent = tpdp.RadialMenuEntryParent("Moment of Prescience")
	MomentOfPrescienceId = radial_parent.add_child_to_standard(attachee, tpdp.RadialMenuStandardNode.Feats)

	#Add a checkbox to turn on and off the various features of the spell
	checkboxACBonus = tpdp.RadialMenuEntryToggle(bonusString + " to AC next attack", "TAG_INTERFACE_HELP")
	checkboxACBonus.link_to_args(args, 2)
	checkboxACBonus.add_as_child(attachee, MomentOfPrescienceId)

	checkboxACBonus = tpdp.RadialMenuEntryToggle(bonusString + " to next save", "TAG_INTERFACE_HELP")
	checkboxACBonus.link_to_args(args, 3)
	checkboxACBonus.add_as_child(attachee, MomentOfPrescienceId)
	
	checkboxACBonus = tpdp.RadialMenuEntryToggle(bonusString + " to next Attack", "TAG_INTERFACE_HELP")
	checkboxACBonus.link_to_args(args, 4)
	checkboxACBonus.add_as_child(attachee, MomentOfPrescienceId)
	
	#checkboxACBonus = tpdp.RadialMenuEntryToggle(bonusString + " to next Skill Check", "TAG_INTERFACE_HELP")
	#checkboxACBonus.link_to_args(args, 5)
	#checkboxACBonus.add_as_child(attachee, MomentOfPrescienceId)
	return 0
コード例 #2
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
コード例 #3
0
ファイル: assassin.py プロジェクト: mercurier/TemplePlus
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
コード例 #4
0
def RadialMenuEntry(attachee, args, evt_obj):
    #print "My radial menu is being built! Attachee: " + str(attachee)

    # add a parent node labeled "Attempt Succeeds!" (combat.mes line 143) to the Class standard node
    radialParent = tpdp.RadialMenuEntryParent(143)  # combat.mes line
    radialParentId = radialParent.add_child_to_standard(
        attachee, tpdp.RadialMenuStandardNode.Class)

    #add a child action node to the above node, labeled "Guidance" (combat.mes line 5055), that triggers a Cast Spell action
    radialAction = tpdp.RadialMenuEntryAction(5055, D20A_CAST_SPELL, 0,
                                              "TAG_INTERFACE_HELP")
    radialAction.add_as_child(attachee, radialParentId)
    return 0
コード例 #5
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
コード例 #6
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
コード例 #7
0
def SwashbucklerLuckyRadial(attachee, args, evt_obj):
    #Add a checkbox to use the reroll if a charge is available
    if args.get_arg(0):
        radial_parent = tpdp.RadialMenuEntryParent("Lucky")
        LuckyID = radial_parent.add_child_to_standard(
            attachee, tpdp.RadialMenuStandardNode.Class)
        checkboxSavingThrow = tpdp.RadialMenuEntryToggle(
            "Reroll Next Missed Saving Throw", "TAG_INTERFACE_HELP")
        checkboxSavingThrow.link_to_args(args, 1)
        checkboxSavingThrow.add_as_child(attachee, LuckyID)
        checkboxAttack = tpdp.RadialMenuEntryToggle(
            "Reroll Next Missed Attack", "TAG_INTERFACE_HELP")
        checkboxAttack.link_to_args(args, 2)
        checkboxAttack.add_as_child(attachee, LuckyID)

    return 0
コード例 #8
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
コード例 #9
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