Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package
- {
- import flash.display.Sprite; // Required for all CH2 mods
- import heroclickerlib.CH2; // Required for all CH2 mods
- import models.Character; // Required to use onCharacterCreated
- import models.MonsterDebuff;
- import models.Characters; // Required to create new Characters
- import heroclickerlib.LevelGraph; // Required to create Level Graphs (Skill Trees)
- import models.Skill; // Required to create Skills
- import models.Buff; // Required to create Buffs
- // Used in the exampleEffect function
- import models.Monster; // Required to work with Monster information
- import models.AttackData; // Required to work with AttackData
- import com.playsaurus.numbers.BigNumber; // Required to work with Big Numbers
- // Sound & Visuals
- import heroclickerlib.world.CharacterDisplay; // Required to use Sounds
- import heroclickerlib.managers.SoundManager; // Required to use Sounds
- import heroclickerlib.GpuMovieClip; // Required to use Movie Clips
- import heroclickerlib.managers.CH2AssetManager; // Required to use Movie Clips
- import heroclickerlib.managers.ItemDropManager;
- import heroclickerlib.managers.Formulas;
- public class ThiefMain extends Sprite
- {
- public var MOD_INFO:Object =
- {
- "name": "Thief",
- "description": "Thief character",
- "version": 1,
- "author": "Playsaurus"
- };
- // Creating a Character
- public var thief:Character = new Character();
- public function onStartup(game:IdleHeroMain):void {
- // Basic Character Info
- // Requires import models.Characters
- thief.assetGroupName = "HelpfulAdventurer"; // Lets a character use Cid's art assets
- thief.name = "Thief"; // Needs to match mod name in MOD_INFO
- thief.flavorName = "Thief";
- thief.flavorClass = "Thiefly person";
- thief.flavor = "A thief who is a thief.";
- thief.availableForCreation = true;
- thief.visibleOnCharacterSelect = true;
- thief.startingSkills = ["Leap", "Throw Dagger", "Distract", "Backstab", "Pick Pocket", "Basic Poison"];
- thief.upgradeableStats = Character.DEFAULT_UPGRADEABLE_STATS;
- //thief.onCharacterDisplayCreated = null;
- thief.monstersPerZone = 10;
- Characters.startingDefaultInstances[thief.name] = thief;
- // Creating a Level Graph (aka Skill Tree)
- // Requires import heroclickerlib.LevelGraph
- thief.levelGraphNodeTypes = {
- // Test Nodes
- "P0": {
- "name": "Poisons",
- "tooltip": "Adds Poison Bounce & Splurt Skills; and Contagion, Slow Poison, Poison dagger, Offhand Poison, Triple Bounce & Poison Damage Traits." ,
- "flavorText": null,
- "alwaysAvailable": true,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Contagion", 1);
- CH2.currentCharacter.addTrait("Slow Poison", 1);
- CH2.currentCharacter.addTrait("Poison Dagger", 3);
- CH2.currentCharacter.addTrait("Poison Damage", 1);
- CH2.currentCharacter.addTrait("Offhand Poison", 1);
- CH2.currentCharacter.addTrait("Triple Bounce", 1);
- var poisonBounce:Skill = CH2.currentCharacter.getStaticSkill("Poison Bounce");
- CH2.currentCharacter.activateSkill(poisonBounce.uid);
- var splurt:Skill = CH2.currentCharacter.getStaticSkill("Splurt");
- CH2.currentCharacter.activateSkill(splurt.uid);
- CH2.currentCharacter.hasPurchasedFirstSkill = true;
- },
- "icon": ""
- },
- "C0": {
- "name": "Combat/Knives",
- "tooltip": "Adds Distract Damage Bonus, Offhand Accuracy, Offhand Damage, Throw Dagger Damage, Backstab Chain & Backstab Damage Traits." ,
- "flavorText": null,
- "alwaysAvailable": true,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Distract Damage Bonus", 1);
- CH2.currentCharacter.addTrait("Offhand Accuracy", 1);
- CH2.currentCharacter.addTrait("Offhand Damage", 1);
- CH2.currentCharacter.addTrait("Throw Dagger Damage", 1);
- CH2.currentCharacter.addTrait("Backstab Damage", 1);
- CH2.currentCharacter.addTrait("Backstab Chain", 1);
- CH2.currentCharacter.addTrait("Fan of Knives", 1);
- },
- "icon": ""
- },
- "G0": {
- "name": "Gambler",
- "tooltip": "Adds Bloopcoin Investment trait & buy/sell skills, Coin Toss skill, and (currently unimplemented) Five-Finger Discount skill." ,
- "flavorText": null,
- "alwaysAvailable": true,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Bloopcoin Investment", 1);
- var buyBloopcoins:Skill = CH2.currentCharacter.getStaticSkill("Buy Bloopcoins");
- CH2.currentCharacter.activateSkill(buyBloopcoins.uid);
- var sellBloopcoins:Skill = CH2.currentCharacter.getStaticSkill("Sell Bloopcoins");
- CH2.currentCharacter.activateSkill(sellBloopcoins.uid);
- var coinToss:Skill = CH2.currentCharacter.getStaticSkill("Coin Toss");
- CH2.currentCharacter.activateSkill(coinToss.uid);
- var fiveFingerDiscount:Skill = CH2.currentCharacter.getStaticSkill("Five-Finger Discount");
- CH2.currentCharacter.activateSkill(fiveFingerDiscount.uid);
- CH2.currentCharacter.hasPurchasedFirstSkill = true;
- },
- "icon": ""
- },
- // Comabat/Knives Nodes
- "C1": {
- "name": "Distract Damage Bonus",
- "tooltip": "Adds Distract Damage Bonus Trait." ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Distract Damage Bonus", 1);
- },
- "icon": ""
- },
- "C2": {
- "name": "Offhand Accuracy",
- "tooltip": "Adds Offhand Accuracy Trait." ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Offhand Accuracy", 1);
- },
- "icon": ""
- },
- "C3": {
- "name": "Offhand Damage",
- "tooltip": "Adds Offhand Damage Trait." ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Offhand Damage", 1);
- },
- "icon": ""
- },
- "C4": {
- "name": "Throw Dagger Damage",
- "tooltip": "Adds Throw Dagger Damage Trait." ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Throw Dagger Damage", 1);
- },
- "icon": ""
- },
- "C5": {
- "name": "Backstab Damage",
- "tooltip": "Adds Backstab Damage Damage Trait." ,
- "flavorText": null,
- "alwaysAvailable": true,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Backstab Damage", 1);
- },
- "icon": ""
- },
- "C6": {
- "name": "Backstab Chain",
- "tooltip": "Adds Backstab Chain Trait." ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Backstab Chain", 1);
- },
- "icon": ""
- },
- "C7": {
- "name": "Fan of Knives",
- "tooltip": "Adds Fan of Knives Trait." ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Fan of Knives", 1);
- },
- "icon": ""
- },
- "C8": {
- "name": "Quick Leap",
- "tooltip": "Muliplies the cooldown of Leap by 0.8." ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- var leap:Skill = CH2.currentCharacter.getSkill("Leap");
- leap.cooldown *= 0.80;
- leap.cooldownRemaining = Math.min(leap.cooldownRemaining, leap.cooldown);
- },
- "icon": ""
- },
- "C9": {
- "name": "Preparation",
- "tooltip": "Gain stacks of preparation and consume them to increase haste." ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Preparation", 1);
- var preparation:Skill = CH2.currentCharacter.getStaticSkill("Preparation");
- CH2.currentCharacter.activateSkill(preparation.uid);
- CH2.currentCharacter.hasPurchasedFirstSkill = true;
- },
- "icon": ""
- },
- "C10": {
- "name": "Extended Distract",
- "tooltip": "Increases the duration of Distract." ,
- "flavorText": null,
- "alwaysAvailable": true,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Extended Distract", 1);
- },
- "icon": ""
- },
- // Poison Nodes
- "P1": {
- "name": "Contagion",
- "tooltip": "When a monster dies 10% of its remaining poison stacks transfer to the next monster." ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Contagion", 1);
- },
- "icon": ""
- },
- "P2": {
- "name": "Slow Poison",
- "tooltip": "Reduces the amount of poison stacks lost per tick by 1." ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Slow Poison", 1);
- },
- "icon": ""
- },
- "P3": {
- "name": "Poison Dagger",
- "tooltip": "Enemies hit with the Throw Dagger skill will have a 30% chance to be poisoned." ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Poison Dagger", 3);
- },
- "icon": ""
- },
- "P4": {
- "name": "Improved Poison Dagger",
- "tooltip": "Increases the chance that enemies hit with the Throw Dagger skill will be poisoned by 10%." ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Poison Dagger", 1);
- },
- "icon": ""
- },
- "P5": {
- "name": "Increase Poison Damage",
- "tooltip": "Increases the amount of damage poisons do." ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Poison Damage", 1);
- },
- "icon": ""
- },
- "P6": {
- "name": "Skill: Poison Bounce",
- "tooltip": "Applies 15 poison stacks to the next 2 monsters." ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- var poisonBounce:Skill = CH2.currentCharacter.getStaticSkill("Poison Bounce");
- CH2.currentCharacter.activateSkill(poisonBounce.uid);
- },
- "icon": ""
- },
- "P7": {
- "name": "Skill: Splurt",
- "tooltip": "For the next 30 seconds, monsters' poison debuffs will gain 2 stacks each tick instead of lose them" ,
- "flavorText": null,
- "alwaysAvailable": true,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- var splurt:Skill = CH2.currentCharacter.getStaticSkill("Splurt");
- CH2.currentCharacter.activateSkill(splurt.uid);
- CH2.currentCharacter.hasPurchasedFirstSkill = true;
- },
- "icon": ""
- },
- "P8": {
- "name": "Offhand Poison",
- "tooltip": "Your offhand attacks have a chance to apply poisons." ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Offhand Poison", 1);
- },
- "icon": ""
- },
- "P9": {
- "name": "Triple Bounce",
- "tooltip": "Poison Bounce will now hit the next 3 monsters." ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Triple Bounce", 1);
- },
- "icon": ""
- },
- // Gambler Nodes
- "G1": {
- "name": "Bloopcoin Investment",
- "tooltip": "Gain the ability to buy and sell Bloopcoins for fun and profit!" ,
- "flavorText": null,
- "alwaysAvailable": true,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- CH2.currentCharacter.addTrait("Bloopcoin Investment", 1);
- var buyBloopcoins:Skill = CH2.currentCharacter.getStaticSkill("Buy Bloopcoins");
- CH2.currentCharacter.activateSkill(buyBloopcoins.uid);
- var sellBloopcoins:Skill = CH2.currentCharacter.getStaticSkill("Sell Bloopcoins");
- CH2.currentCharacter.activateSkill(sellBloopcoins.uid);
- CH2.currentCharacter.hasPurchasedFirstSkill = true;
- },
- "icon": ""
- },
- "G2": {
- "name": "Coin Toss",
- "tooltip": "Toss some of your gold at a monster to do damage" ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- var coinToss:Skill = CH2.currentCharacter.getStaticSkill("Coin Toss");
- CH2.currentCharacter.activateSkill(coinToss.uid);
- },
- "icon": ""
- },
- "G3": {
- "name": "Five-Finger Discount",
- "tooltip": "A chance to steal a random catalog item from a monster (unimplemented)" ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- var fiveFingerDiscount:Skill = CH2.currentCharacter.getStaticSkill("Five-Finger Discount");
- CH2.currentCharacter.activateSkill(fiveFingerDiscount.uid);
- },
- "icon": ""
- },
- // General Stat Nodes
- "Cc": {
- "name": "Crit Chance",
- "tooltip": "Adds 2% to your chance to score a critical hit." ,
- "flavorText": "Ever wonder what happens when you get over 100% Crit Chance? The Ancients once knew, but that is ancient history.",
- "alwaysAvailable": true,
- "setupFunction": function(){},
- "purchaseFunction": function() {CH2.currentCharacter.levelUpStat(CH2.STAT_CRIT_CHANCE)},
- "icon": "critChance"
- },
- "Cd": {
- "name": "Crit Damage",
- "tooltip": "Multiplies the damage of your critical hits by 120%." ,
- "flavorText": "When a number is multiplied by a fixed amount (greater than 1) many times, that number is said to grow \"exponentially\". This is because that process is usually represented by a formula that uses exponential notation.",
- "alwaysAvailable": true,
- "setupFunction": function(){},
- "purchaseFunction": function() {CH2.currentCharacter.levelUpStat(CH2.STAT_CRIT_DAMAGE)},
- "icon": "critDamage"
- },
- "H": {
- "name": "Haste",
- "tooltip": "Multiplies your Haste by 105%." ,
- "flavorText": "Haste affects the rate that you auto-attack, and all cooldown speeds, including Automator cooldown speeds.",
- "alwaysAvailable": true,
- "setupFunction": function(){},
- "purchaseFunction": function() {CH2.currentCharacter.levelUpStat(CH2.STAT_HASTE)},
- "icon": "haste"
- },
- "Cl": {
- "name": "Click Damage",
- "tooltip": "Multiplies your click damage by 110%." ,
- "flavorText": "This affects damage from all skills that \"click\". But it does not affect auto-attacks, because those are not \"clicks\".",
- "alwaysAvailable": true,
- "setupFunction": function(){},
- "purchaseFunction": function() {CH2.currentCharacter.levelUpStat(CH2.STAT_CLICK_DAMAGE)},
- "icon": "clickDamage"
- }
- /*
- // Node that adds a skill
- "N1": {
- "name": "Skill: Example Skill Node",
- "tooltip": "Adds Example Skill to this Character" ,
- "flavorText": null,
- "alwaysAvailable": true,
- "setupFunction": function() {},
- "purchaseFunction": function() {
- var skill:Skill = CH2.currentCharacter.getStaticSkill("Example Skill");
- CH2.currentCharacter.activateSkill(skill.uid);
- CH2.currentCharacter.hasPurchasedFirstSkill = true;
- },
- "icon": ""
- },
- // Nodes that add traits
- "N2": {
- "name": "Example Trait Node",
- "tooltip": "Increases the damage of Example Skill",
- "flavorText": "Adds ExampleTrait with a value of 1",
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() { CH2.currentCharacter.addTrait("ExampleTrait", 1); },
- "icon": ""
- },
- "N3": {
- "name": "Another Trait Node",
- "tooltip": "Increases the damage of Example Skill",
- "flavorText": "Adds ExampleTrait with a value of 2",
- "alwaysAvailable": false,
- "setupFunction": function() {},
- "purchaseFunction": function() { CH2.currentCharacter.addTrait("ExampleTrait", 2); },
- "icon": ""
- },
- // Node that levels up a stat
- "N4": {
- "name": "Example Stat Node",
- "tooltip": "Levels up this character's crit chance based on statValueFunctions[CH2.STAT_CRIT_CHANCE]",
- "flavorText": null,
- "alwaysAvailable": true,
- "setupFunction": function() {},
- "purchaseFunction": function () { CH2.currentCharacter.levelUpStat(CH2.STAT_CRIT_CHANCE); },
- "icon": ""
- },
- // Another node that adds a skill
- "N5": {
- "name": "Skill: Example Buff Skill Node",
- "tooltip": "Add the Buff Example Skill to this character",
- "flavorText": null,
- "alwaysAvailable": true,
- "setupFunction": function() {},
- "purchaseFunction": function () {
- var skill:Skill = CH2.currentCharacter.getStaticSkill("Buff Example Skill");
- CH2.currentCharacter.activateSkill(skill.uid);
- },
- "icon": ""
- },
- // Node that unlocks the automator and creates a gem and stone
- "AN": {
- "name": "Automator Examples",
- "tooltip": "Unlocks the Automator, Example Skill Gem, and Example Cooldown Stone" ,
- "flavorText": null,
- "alwaysAvailable": false,
- "setupFunction": function() { //setupFunction is run from the onCharacterCreated function below
- CH2.currentCharacter.automator.addCooldownStone("stone_ExampleCooldown", 5000);
- CH2.currentCharacter.automator.addSkillGem("gem_exampleSkill", exampleSkill);
- CH2.currentCharacter.automator.addGem("clicktest", "Perform a click", null, "Performs a single click.", function():Boolean{ CH2.world.onWorldClick(); return true; }, function():Boolean{ return true; }, 0);
- },
- "purchaseFunction": function() {
- CH2.currentCharacter.onAutomatorUnlocked();
- CH2.currentCharacter.automator.unlockStone("stone_ExampleCooldown");
- CH2.currentCharacter.automator.unlockGem("gem_exampleSkill");
- CH2.currentCharacter.automator.unlockGem("clicktest");
- },
- "icon": ""
- }*/
- }
- // thief.levelGraphObject = {"edges":[{"1":[1, 2]}, {"2":[1, 3]}, {"3":[1, 4]}, {"4":[4, 5]}, {"5":[1, 6]}], "nodes":[{"1":{"val":"P1", "x":0, "y":0}}, {"2":{"val":"P2", "x":75, "y":0}}, {"3":{"val":"P2", "x": -75, "y":0}}, {"4":{"val":"P3", "x":0, "y": -75}}, {"5":{"val":"P4", "x":0, "y": -150}}, {"6":{"val":"P5", "x":0, "y":75}}]};
- //thief.levelGraphObject = {"nodes":[{"14":{"x":569, "val":"Cc", "y":643}}, {"15":{"x":624, "val":"Cd", "y":641}}, {"16":{"x":568, "val":"H", "y":693}}, {"17":{"x":624, "val":"Cl", "y":691}}, {"19":{"x": -1, "val":"P7", "y":1}}, {"21":{"x":65, "val":"P3", "y":100}}, {"22":{"x": -2, "val":"P2", "y":100}}, {"23":{"x": -2, "val":"P6", "y":195}}, {"24":{"x":65, "val":"P5", "y":195}}, {"25":{"x":65, "val":"P1", "y":292}}, {"26":{"x":127, "val":"P2", "y":292}}, {"27":{"x":161, "val":"P9", "y":474}}, {"29":{"x":67, "val":"P8", "y":380}}, {"30":{"x":161, "val":"P5", "y":380}}, {"31":{"x":222, "val":"P1", "y":474}}, {"32":{"x":163, "val":"P4", "y":539}}, {"33":{"x":101, "val":"P2", "y":474}}, {"34":{"x":65, "val":"Cl", "y":1}}, {"28":{"x": -2, "val":"P4", "y":292}}, {"35":{"x":630, "val":"P0", "y":411}}, {"36":{"x":630, "val":"C0", "y":481}}, {"37":{"x":630, "val":"G0", "y":551}}, {"39":{"x":463, "val":"C2", "y":1}}, {"40":{"x":564, "val":"C3", "y":1}}, {"41":{"x":365, "val":"C4", "y":103}}, {"42":{"x":463, "val":"C5", "y":103}}, {"43":{"x":564, "val":"C6", "y":103}}, {"44":{"x":463, "val":"C7", "y":221}}, {"45":{"x":365, "val":"C1", "y":0}}, {"49":{"x": -303, "val":"G1", "y": -5}}, {"50":{"x": -303, "val":"G2", "y":96}}, {"51":{"x": -302, "val":"G3", "y":206}}, {"52":{"x":565, "val":"C8", "y":221}}], "edges":[{"1":[29, 30]}, {"2":[27, 33]}, {"3":[41, 42]}, {"4":[42, 45]}, {"5":[40, 42]}, {"6":[28, 29]}, {"7":[41, 45]}, {"8":[25, 26]}, {"9":[31, 32]}, {"10":[49, 50]}, {"11":[23, 24]}, {"12":[39, 40]}, {"13":[24, 25]}, {"14":[44, 52]}, {"15":[42, 43]}, {"16":[27, 31]}, {"17":[25, 28]}, {"18":[42, 52]}, {"19":[21, 22]}, {"20":[21, 34]}, {"21":[43, 52]}, {"22":[19, 34]}, {"23":[27, 30]}, {"24":[40, 43]}, {"25":[50, 51]}, {"26":[42, 44]}, {"27":[32, 33]}, {"28":[39, 45]}, {"29":[26, 29]}, {"30":[22, 23]}, {"31":[39, 42]}, {"32":[41, 44]}]};
- //thief.levelGraphObject = {"edges":[{"1":[25, 26]}, {"2":[42, 45]}, {"3":[42, 52]}, {"4":[40, 43]}, {"5":[43, 52]}, {"6":[23, 24]}, {"7":[22, 23]}, {"8":[44, 53]}, {"9":[27, 33]}, {"10":[41, 42]}, {"11":[24, 25]}, {"12":[40, 42]}, {"13":[21, 34]}, {"14":[41, 45]}, {"15":[25, 28]}, {"16":[42, 43]}, {"17":[27, 30]}, {"18":[29, 30]}, {"19":[49, 50]}, {"20":[39, 40]}, {"21":[32, 33]}, {"22":[42, 44]}, {"23":[41, 53]}, {"24":[44, 52]}, {"25":[21, 22]}, {"26":[26, 29]}, {"27":[28, 29]}, {"28":[50, 51]}, {"29":[39, 42]}, {"30":[42, 53]}, {"31":[31, 32]}, {"32":[27, 31]}, {"33":[19, 34]}, {"34":[39, 45]}], "nodes":[{"14":{"x":569, "val":"Cc", "y":643}}, {"15":{"x":624, "val":"Cd", "y":641}}, {"16":{"x":568, "val":"H", "y":693}}, {"17":{"x":624, "val":"Cl", "y":691}}, {"19":{"x": -1, "val":"P7", "y":1}}, {"21":{"x":65, "val":"P3", "y":100}}, {"22":{"x": -2, "val":"P2", "y":100}}, {"23":{"x": -2, "val":"P6", "y":195}}, {"24":{"x":65, "val":"P5", "y":195}}, {"25":{"x":65, "val":"P1", "y":292}}, {"26":{"x":127, "val":"P2", "y":292}}, {"27":{"x":161, "val":"P9", "y":474}}, {"29":{"x":67, "val":"P8", "y":380}}, {"30":{"x":161, "val":"P5", "y":380}}, {"31":{"x":222, "val":"P1", "y":474}}, {"32":{"x":163, "val":"P4", "y":539}}, {"33":{"x":101, "val":"P2", "y":474}}, {"34":{"x":65, "val":"Cl", "y":1}}, {"28":{"x": -2, "val":"P4", "y":292}}, {"35":{"x":630, "val":"P0", "y":411}}, {"36":{"x":630, "val":"C0", "y":481}}, {"37":{"x":630, "val":"G0", "y":551}}, {"39":{"x":463, "val":"C2", "y":1}}, {"40":{"x":564, "val":"C3", "y":1}}, {"41":{"x":365, "val":"C4", "y":103}}, {"42":{"x":463, "val":"C5", "y":103}}, {"43":{"x":564, "val":"C6", "y":103}}, {"44":{"x":463, "val":"C8", "y":221}}, {"45":{"x":365, "val":"C1", "y":0}}, {"49":{"x": -303, "val":"G1", "y": -5}}, {"50":{"x": -303, "val":"G2", "y":96}}, {"51":{"x": -302, "val":"G3", "y":206}}, {"52":{"x":565, "val":"C9", "y":221}}, {"53":{"x":365, "val":"C7", "y":221}}]};
- thief.levelGraphObject = {"nodes":[{"14":{"x":569, "val":"Cc", "y":643}}, {"15":{"x":624, "val":"Cd", "y":641}}, {"16":{"x":568, "val":"H", "y":693}}, {"17":{"x":624, "val":"Cl", "y":691}}, {"19":{"x": -1, "val":"P7", "y":1}}, {"21":{"x":65, "val":"P3", "y":100}}, {"22":{"x": -2, "val":"P2", "y":100}}, {"23":{"x": -2, "val":"P6", "y":195}}, {"24":{"x":65, "val":"P5", "y":195}}, {"25":{"x":65, "val":"P1", "y":292}}, {"26":{"x":127, "val":"P2", "y":292}}, {"27":{"x":161, "val":"P9", "y":474}}, {"29":{"x":67, "val":"P8", "y":380}}, {"30":{"x":161, "val":"P5", "y":380}}, {"31":{"x":222, "val":"P1", "y":474}}, {"32":{"x":163, "val":"P4", "y":539}}, {"33":{"x":101, "val":"P2", "y":474}}, {"34":{"x":65, "val":"Cl", "y":1}}, {"28":{"x": -2, "val":"P4", "y":292}}, {"35":{"x":630, "val":"P0", "y":411}}, {"36":{"x":630, "val":"C0", "y":481}}, {"37":{"x":630, "val":"G0", "y":551}}, {"39":{"x":463, "val":"C2", "y":1}}, {"40":{"x":564, "val":"C3", "y":1}}, {"41":{"x":365, "val":"C4", "y":103}}, {"42":{"x":463, "val":"C5", "y":103}}, {"43":{"x":564, "val":"C6", "y":103}}, {"44":{"x":463, "val":"C8", "y":221}}, {"45":{"x":365, "val":"C1", "y":0}}, {"49":{"x": -303, "val":"G1", "y": -5}}, {"50":{"x": -303, "val":"G2", "y":96}}, {"51":{"x": -302, "val":"G3", "y":206}}, {"52":{"x":565, "val":"C9", "y":221}}, {"53":{"x":365, "val":"C7", "y":221}}, {"54":{"x":463, "val":"C10", "y":296}}], "edges":[{"1":[52, 54]}, {"2":[19, 34]}, {"3":[31, 32]}, {"4":[41, 45]}, {"5":[42, 44]}, {"6":[23, 24]}, {"7":[44, 54]}, {"8":[39, 40]}, {"9":[29, 30]}, {"10":[42, 43]}, {"11":[28, 29]}, {"12":[44, 53]}, {"13":[39, 42]}, {"14":[42, 52]}, {"15":[42, 54]}, {"16":[24, 25]}, {"17":[43, 52]}, {"18":[27, 31]}, {"19":[21, 22]}, {"20":[21, 34]}, {"21":[25, 26]}, {"22":[39, 45]}, {"23":[32, 33]}, {"24":[42, 53]}, {"25":[41, 53]}, {"26":[25, 28]}, {"27":[50, 51]}, {"28":[22, 23]}, {"29":[49, 50]}, {"30":[27, 30]}, {"31":[26, 29]}, {"32":[40, 43]}, {"33":[27, 33]}, {"34":[41, 42]}, {"35":[53, 54]}, {"36":[42, 45]}, {"37":[44, 52]}, {"38":[40, 42]}]};
- thief.levelGraph = LevelGraph.loadGraph(thief.levelGraphObject, thief);
- var leap:Skill = new Skill();
- leap.modName = MOD_INFO["name"];
- leap.name = "Leap";
- leap.description = "Leap backwards";
- leap.cooldown = 4000;
- leap.iconId = 158;
- leap.manaCost = 0;
- leap.energyCost = 1;
- leap.effectFunction = leapEffect;
- leap.ignoresGCD = false;
- leap.maximumRange = 9000;
- leap.minimumRange = 0;
- leap.tooltipFunction = function():Object {
- return this.skillTooltip("Leap backwards");
- }
- Character.staticSkillInstances[leap.name] = leap;
- var throwDagger:Skill = new Skill();
- throwDagger.modName = MOD_INFO["name"];
- throwDagger.name = "Throw Dagger";
- throwDagger.description = "Throw a dagger at an enemy outside of melee range.";
- throwDagger.cooldown = 2000;
- throwDagger.iconId = 166;
- throwDagger.manaCost = 0;
- throwDagger.energyCost = 2;
- throwDagger.effectFunction = throwDaggerEffect;
- throwDagger.ignoresGCD = true;
- throwDagger.maximumRange = 600;
- throwDagger.minimumRange = 150;
- throwDagger.tooltipFunction = function():Object {
- return this.skillTooltip("Throw dagger");
- }
- Character.staticSkillInstances[throwDagger.name] = throwDagger;
- var distract:Skill = new Skill();
- distract.modName = MOD_INFO["name"];
- distract.name = "Distract";
- distract.description = "Distract";
- distract.cooldown = 6000;
- distract.iconId = 57;
- distract.manaCost = 0;
- distract.energyCost = 1;
- distract.effectFunction = distractEffect;
- distract.ignoresGCD = true;
- distract.maximumRange = 9000;
- distract.minimumRange = 150;
- distract.tooltipFunction = function():Object {
- return this.skillTooltip("Distract");
- }
- Character.staticSkillInstances[distract.name] = distract;
- var pickPocket:Skill = new Skill();
- pickPocket.modName = MOD_INFO["name"];
- pickPocket.name = "Pick Pocket";
- pickPocket.description = "Picks a Pocket";
- pickPocket.cooldown = 10000;
- pickPocket.iconId = 97;
- pickPocket.manaCost = 0;
- pickPocket.energyCost = 10;
- pickPocket.effectFunction = pickPocketEffect;
- pickPocket.ignoresGCD = false;
- pickPocket.maximumRange = 150;
- pickPocket.minimumRange = 0;
- pickPocket.tooltipFunction = function():Object {
- return this.skillTooltip("Picks a Pocket");
- }
- Character.staticSkillInstances[pickPocket.name] = pickPocket;
- var basicPoison:Skill = new Skill();
- basicPoison.modName = MOD_INFO["name"];
- basicPoison.name = "Basic Poison";
- basicPoison.description = "Applies 25 poison stacks to current monster";
- basicPoison.cooldown = 5000;
- basicPoison.iconId = 43;
- basicPoison.manaCost = 0;
- basicPoison.energyCost = 5;
- basicPoison.effectFunction = basicPoisonEffect;
- basicPoison.ignoresGCD = false;
- basicPoison.maximumRange = 9000;
- basicPoison.minimumRange = 0;
- basicPoison.tooltipFunction = function():Object {
- return this.skillTooltip("Applies 25 poison stacks to current monster");
- }
- Character.staticSkillInstances[basicPoison.name] = basicPoison;
- var bouncePoison:Skill = new Skill();
- bouncePoison.modName = MOD_INFO["name"];
- bouncePoison.name = "Poison Bounce";
- bouncePoison.description = "Applies 15 poison stacks to the next 2 monsters";
- bouncePoison.cooldown = 5000;
- bouncePoison.iconId = 185;
- bouncePoison.manaCost = 0;
- bouncePoison.energyCost = 15;
- bouncePoison.effectFunction = bouncePoisonEffect;
- bouncePoison.ignoresGCD = false;
- bouncePoison.maximumRange = 200;
- bouncePoison.minimumRange = 0;
- bouncePoison.tooltipFunction = function():Object {
- return this.skillTooltip("Applies 15 poison stacks to the next 2 monsters");
- }
- Character.staticSkillInstances[bouncePoison.name] = bouncePoison;
- var splurt:Skill = new Skill();
- splurt.modName = MOD_INFO["name"];
- splurt.name = "Splurt";
- splurt.description = "For the next 30 seconds, monsters' poison debuffs will gain 2 stacks each tick instead of lose them";
- splurt.cooldown = 150000;
- splurt.iconId = 108;
- splurt.manaCost = 0;
- splurt.energyCost = 15;
- splurt.effectFunction = splurtEffect;
- splurt.ignoresGCD = false;
- splurt.maximumRange = 9000;
- splurt.minimumRange = 0;
- splurt.tooltipFunction = function():Object {
- return this.skillTooltip("For the next 30 seconds, monsters' poison debuffs will gain 2 stacks each tick instead of lose them");
- }
- Character.staticSkillInstances[splurt.name] = splurt;
- var backstab:Skill = new Skill();
- backstab.modName = MOD_INFO["name"];
- backstab.name = "Backstab";
- backstab.description = "Stabs a Back";
- backstab.cooldown = 5000;
- backstab.iconId = 102;
- backstab.manaCost = 0;
- backstab.energyCost = 5;
- backstab.effectFunction = backstabEffect;
- backstab.ignoresGCD = false;
- backstab.maximumRange = 150;
- backstab.minimumRange = 0;
- backstab.tooltipFunction = function():Object {
- return this.skillTooltip("Stabs a Back");
- }
- Character.staticSkillInstances[backstab.name] = backstab;
- var preparation:Skill = new Skill();
- preparation.modName = MOD_INFO["name"];
- preparation.name = "Preparation";
- preparation.description = "Consume stacks of preparation to temporarily increase haste";
- preparation.cooldown = 5000;
- preparation.iconId = 91;
- preparation.manaCost = 0;
- preparation.energyCost = 5;
- preparation.effectFunction = preparationEffect;
- preparation.ignoresGCD = false;
- preparation.maximumRange = 9000;
- preparation.minimumRange = 0;
- preparation.tooltipFunction = function():Object {
- return this.skillTooltip("Consume stacks of preparation to temporarily increase haste");
- }
- Character.staticSkillInstances[preparation.name] = preparation;
- var coinToss:Skill = new Skill();
- coinToss.modName = MOD_INFO["name"];
- coinToss.name = "Coin Toss";
- coinToss.description = "Toss some of your gold at a monster to do damage";
- coinToss.cooldown = 5000;
- coinToss.iconId = 96;
- coinToss.manaCost = 0;
- coinToss.energyCost = 0;
- coinToss.effectFunction = coinTossEffect;
- coinToss.ignoresGCD = false;
- coinToss.maximumRange = 150;
- coinToss.minimumRange = 0;
- coinToss.tooltipFunction = function():Object {
- return this.skillTooltip("Toss some of your gold at a monster to do damage");
- }
- Character.staticSkillInstances[coinToss.name] = coinToss;
- var fiveFingerDiscount:Skill = new Skill();
- fiveFingerDiscount.modName = MOD_INFO["name"];
- fiveFingerDiscount.name = "Five-Finger Discount";
- fiveFingerDiscount.description = "A chance to steal a random catalog item from a monster";
- fiveFingerDiscount.cooldown = 5000;
- fiveFingerDiscount.iconId = 98;
- fiveFingerDiscount.manaCost = 0;
- fiveFingerDiscount.energyCost = 0;
- fiveFingerDiscount.effectFunction = fiveFingerDiscountEffect;
- fiveFingerDiscount.ignoresGCD = false;
- fiveFingerDiscount.maximumRange = 150;
- fiveFingerDiscount.minimumRange = 0;
- fiveFingerDiscount.tooltipFunction = function():Object {
- return this.skillTooltip("A chance to steal a random catalog item from a monster");
- }
- Character.staticSkillInstances[fiveFingerDiscount.name] = fiveFingerDiscount;
- var buyBloopcoins:Skill = new Skill();
- buyBloopcoins.modName = MOD_INFO["name"];
- buyBloopcoins.name = "Buy Bloopcoins";
- buyBloopcoins.description = "Spend gold to buy bloopcoins";
- buyBloopcoins.cooldown = 0;
- buyBloopcoins.iconId = 94;
- buyBloopcoins.manaCost = 0;
- buyBloopcoins.energyCost = 0;
- buyBloopcoins.effectFunction = buyBloopcoinsEffect;
- buyBloopcoins.ignoresGCD = true;
- buyBloopcoins.maximumRange = 9000;
- buyBloopcoins.minimumRange = 0;
- buyBloopcoins.tooltipFunction = function():Object {
- return this.skillTooltip("Spend gold to buy bloopcoins");
- }
- Character.staticSkillInstances[buyBloopcoins.name] = buyBloopcoins;
- var sellBloopcoins:Skill = new Skill();
- sellBloopcoins.modName = MOD_INFO["name"];
- sellBloopcoins.name = "Sell Bloopcoins";
- sellBloopcoins.description = "Sell your bloopcoins for gold";
- sellBloopcoins.cooldown = 0;
- sellBloopcoins.iconId = 95;
- sellBloopcoins.manaCost = 0;
- sellBloopcoins.energyCost = 0;
- sellBloopcoins.effectFunction = sellBloopcoinsEffect;
- sellBloopcoins.ignoresGCD = true;
- sellBloopcoins.maximumRange = 9000;
- sellBloopcoins.minimumRange = 0;
- sellBloopcoins.tooltipFunction = function():Object {
- return this.skillTooltip("Sell your bloopcoins for gold");
- }
- Character.staticSkillInstances[sellBloopcoins.name] = sellBloopcoins;
- /*
- var exampleSkill:Skill = new Skill;
- exampleSkill.modName = MOD_INFO["name"];
- exampleSkill.name = "Example Skill";
- exampleSkill.description = "";
- exampleSkill.cooldown = 1000;
- exampleSkill.iconId = 100;
- exampleSkill.manaCost = 0;
- exampleSkill.energyCost = 1;
- exampleSkill.minimumAscensions = 0;
- exampleSkill.effectFunction = exampleEffect; // References exampleEffect function defined below
- exampleSkill.ignoresGCD = false;
- exampleSkill.maximumRange = 9000;
- exampleSkill.minimumRange = 0;
- exampleSkill.tooltipFunction = function():Object {
- var traitValue:Number = CH2.currentCharacter.getTrait("ExampleTrait");
- var damage:Number = 100 * (1 + traitValue);
- return this.skillTooltip("Does 100 * (1 + " + traitValue + ") damage to next monster (" + damage + " damage)");
- }
- Character.staticSkillInstances[exampleSkill.name] = exampleSkill;
- // Another Skill
- var buffExampleSkill:Skill = new Skill;
- buffExampleSkill.modName = MOD_INFO["name"];
- buffExampleSkill.name = "Buff Example Skill";
- buffExampleSkill.description = "";
- buffExampleSkill.cooldown = 1000;
- buffExampleSkill.iconId = 101;
- buffExampleSkill.manaCost = 10;
- buffExampleSkill.energyCost = 0;
- buffExampleSkill.minimumAscensions = 0;
- buffExampleSkill.effectFunction = buffExampleEffect; // References buffExampleEffect function defined below
- buffExampleSkill.ignoresGCD = false;
- buffExampleSkill.maximumRange = 9000;
- buffExampleSkill.minimumRange = 0;
- buffExampleSkill.tooltipFunction = function():Object {
- return this.skillTooltip("Adds Example Buff to this Character");
- }
- Character.staticSkillInstances[buffExampleSkill.name] = buffExampleSkill;
- */
- // Overwriting the default stat values and level up functions
- thief.statBaseValues[CH2.STAT_CRIT_CHANCE] = 0.1;
- // Default: statValueFunctions[CH2.STAT_CRIT_CHANCE] = Character.linear(0.02);
- thief.statValueFunctions[CH2.STAT_HASTE] = Character.linear(0.1, 1);
- thief.statValueFunctions[CH2.STAT_CRIT_DAMAGE] = Character.linear(0.03, 1);
- // Default: statValueFunctions[CH2.STAT_CLICK_DAMAGE] = exponentialMultiplier(1.1);
- }
- public function onCharacterCreated(characterInstance:Character):void
- {
- if (characterInstance.name == "Thief") {
- //characterInstance.onCharacterDisplayCreated = setUpDisplay; // References setUpDisplay function defined below
- characterInstance.onCharacterDisplayCreatedHandler = this;
- //characterInstance.attack = thiefAttack;
- //characterInstance.onKilledMonster = thiefOnKilledMonster;
- characterInstance.attackHandler = this;
- characterInstance.onKilledMonsterHandler = this;
- // Adds a mod dependency to character saves created with this mod
- characterInstance.modDependencies[MOD_INFO["name"]] = true;
- }
- }
- // Function Referenced by onCharacterDisplayCreated
- //public function setUpDisplay(display:CharacterDisplay):void // Requires import heroclickerlib.world.CharacterDisplay
- public function onCharacterDisplayCreatedOverride(display:CharacterDisplay):void
- {
- // Loading a Sound
- // Requires import heroclickerlib.managers.SoundManager
- SoundManager.instance.loadAudioClass("audio/HelpfulAdventurer/power_surge_activate");
- // Default Attack Sounds
- SoundManager.instance.loadAudioClass("audio/HelpfulAdventurer/critical_hit");
- SoundManager.instance.loadAudioClass("audio/HelpfulAdventurer/hit");
- }
- public function leapEffect():void
- {
- var character:Character = CH2.currentCharacter;
- character.y -= 250;
- character.state = Character.STATE_UNKNOWN;
- var buff:Buff = new Buff();
- buff.name = "Leap";
- buff.iconId = 99;
- buff.duration = 2000;
- buff.buffStat(CH2.STAT_MOVEMENT_SPEED, 0.001);
- character.buffs.addBuff(buff);
- }
- public function distractEffect():void
- {
- var character:Character = CH2.currentCharacter;
- var target:Monster = CH2.world.getNextMonster();
- if (target)
- {
- var debuff:MonsterDebuff = new MonsterDebuff(target);
- debuff.duration = 5000 + (5000 * character.getTrait("Extended Distract"));
- debuff.name = "Distract";
- debuff.startFunction = function() {
- target.display.display.scaleX = -1;
- }
- debuff.attackedFunction = function(attackData:AttackData):void
- {
- attackData.damage.timesEqualsN(1.25 + 0.05 * character.getTrait("Distract Damage Bonus"));
- }
- debuff.finishFunction = function()
- {
- target.display.display.scaleX = 1;
- }
- target.addDebuff(debuff);
- }
- }
- public function throwDaggerEffect():void {
- var character:Character = CH2.currentCharacter;
- var target:Monster;
- var daggerCount:Number = character.getTrait("Fan of Knives") + 1;
- var damageMultiplier:Number = 5 + character.getTrait("Throw Dagger Damage");
- var poisonDagger:Number = character.getTrait("Poison Dagger");
- for (var i:int = 0; i < daggerCount; i++)
- {
- target = CH2.world.getNextMonster();
- if (target)
- {
- var daggerAttack:AttackData = new AttackData();
- daggerAttack.damage = character.clickDamage.multiplyN(damageMultiplier);
- target.takeDamage(daggerAttack);
- if (poisonDagger)
- {
- if (CH2.roller.miscRoller.boolean(0.1 * poisonDagger))
- {
- applyPoisonDebuff(target,5);
- }
- }
- }
- }
- }
- public function pickPocketEffect():void
- {
- var character:Character = CH2.currentCharacter;
- var target:Monster = CH2.world.getNextMonster();
- if (target)
- {
- var goldTaken:BigNumber = Formulas.instance.getGoldForZone(character.currentZone);
- if (!target.hasDebuff("Distract"))
- {
- goldTaken.timesEqualsN(0.25);
- }
- character.addGold(goldTaken);
- ItemDropManager.instance.goldSplash(goldTaken, target.x, target.y, character, "N");
- }
- }
- public function backstabEffect():void
- {
- var character:Character = CH2.currentCharacter;
- var target:Monster = CH2.world.getNextMonster();
- if (target)
- {
- var damage:BigNumber;
- if (target.hasDebuff("Distract"))
- {
- damage = new BigNumber(character.clickDamage.multiplyN(15 + 1.5 * character.getTrait("Backstab Damage")));
- }
- else
- {
- damage = new BigNumber(0);
- }
- var attackData:AttackData = new AttackData();
- attackData.monster = target;
- attackData.damage = damage;
- character.attack(attackData);
- var backstabChain:Number = character.getTrait("Backstab Chain");
- if (backstabChain)
- {
- if (CH2.roller.miscRoller.boolean(0.05 * backstabChain))
- {
- character.getSkill("Backstab").cooldownRemaining = 0;
- character.gcdRemaining = 0;
- }
- }
- }
- }
- public function preparationEffect():void
- {
- var character:Character = CH2.currentCharacter;
- if (character.buffs.hasBuffByName("Preparation"))
- {
- var prepBuff:Buff = character.buffs.getBuff("Preparation");
- var hasteBuff:Buff = new Buff();
- hasteBuff.name = "Prepared Haste";
- hasteBuff.iconId = 91;
- hasteBuff.duration = 15000;
- hasteBuff.tooltipFunction = function()
- {
- return {
- "header": "Prepared Haste",
- "body": "Haste increased!"
- };
- }
- hasteBuff.buffStat(CH2.STAT_HASTE, 1 + prepBuff.stacks);
- character.buffs.addBuff(hasteBuff);
- prepBuff.stacks = 0;
- //character.buffs.removeBuff(prepBuff);
- }
- }
- public function basicPoisonEffect():void
- {
- var target:Monster = CH2.world.getNextMonster();
- if (target)
- {
- applyPoisonDebuff(target,25);
- }
- }
- public function splurtEffect():void
- {
- var character:Character = CH2.currentCharacter;
- var splurtBuff:Buff = new Buff();
- splurtBuff.name = "Splurt";
- splurtBuff.iconId = 108;
- splurtBuff.duration = 30000;
- splurtBuff.tooltipFunction = function()
- {
- return {
- "header": "Splurt",
- "body": "Poisons applied to monsters gain 2 stacks each tick"
- };
- }
- character.buffs.addBuff(splurtBuff);
- }
- public function bouncePoisonEffect():void
- {
- var character:Character = CH2.currentCharacter;
- var characterY:Number = character.y;
- var characterX:Number = character.x;
- var monster:Monster;
- var targets:Array;
- if (character.getTrait("Triple Bounce"))
- {
- targets = CH2.world.monsters.getMonstersInRadius(characterX, characterY, 600);
- }
- else
- {
- targets = CH2.world.monsters.getMonstersInRadius(characterX, characterY, 400);
- }
- var targetsLength:int = targets.length;
- for (var i:int = 0; i < targetsLength; i++)
- {
- monster = targets[i];
- if (monster.isAlive && monster.y >= characterY)
- {
- applyPoisonDebuff(monster,15);
- }
- }
- }
- public function coinTossEffect():void
- {
- var target = CH2.world.getNextMonster();
- var character:Character = CH2.currentCharacter;
- if (target)
- {
- var goldToThrow:BigNumber = new BigNumber(5);
- if (character.gold.gte(goldToThrow)) {
- character.subtractGold(goldToThrow);
- var goldDamage:BigNumber = new BigNumber(goldToThrow.multiplyN(10));
- var goldAttackData:AttackData = new AttackData();
- goldAttackData.damage = goldDamage;
- target.takeDamage(goldAttackData);
- }
- }
- }
- public function fiveFingerDiscountEffect():void
- {
- var target = CH2.world.getNextMonster();
- var character:Character = CH2.currentCharacter;
- if (target)
- {
- }
- }
- var bloopcoins:Number = 0;
- var exchangeRate:Number = 1;
- public function buyBloopcoinsEffect():void
- {
- var character = CH2.currentCharacter;
- var amountToBuy:Number = 5;
- var bloopcoinCost:BigNumber = new BigNumber(amountToBuy * exchangeRate);
- if (character.gold.gte(bloopcoinCost))
- {
- character.subtractGold(bloopcoinCost);
- bloopcoins += amountToBuy;
- if (!character.buffs.hasBuffByName("Bloopcoins"))
- {
- applyBloopcoinBuff();
- }
- }
- }
- public function sellBloopcoinsEffect():void
- {
- var character = CH2.currentCharacter;
- if (bloopcoins > 0)
- {
- var bloopcoinValue:BigNumber = new BigNumber(bloopcoins * exchangeRate);
- character.addGold(bloopcoinValue);
- bloopcoins = 0;
- }
- }
- public function applyExchangeRateBuff():void
- {
- var exchangeRateBuff:Buff = new Buff();
- exchangeRateBuff.name = "Bloopcoin Exchange Rate";
- exchangeRateBuff.iconId = 93;
- exchangeRateBuff.isUntimedBuff = true;
- exchangeRateBuff.tooltipFunction = function() {
- return {
- "header": "Bloopcoin Exchange Rate",
- "body": "Current rate: " + exchangeRate
- };
- }
- CH2.currentCharacter.buffs.addBuff(exchangeRateBuff);
- }
- public function applyBloopcoinBuff():void
- {
- var bloopcoinBuff:Buff = new Buff();
- bloopcoinBuff.name = "Bloopcoins";
- bloopcoinBuff.iconId = 94;
- bloopcoinBuff.isUntimedBuff = true;
- bloopcoinBuff.tooltipFunction = function() {
- return {
- "header": "Bloopcoins!",
- "body": "Current amount: " + bloopcoins
- };
- }
- CH2.currentCharacter.buffs.addBuff(bloopcoinBuff);
- }
- public function applyPreparationBuff():void
- {
- var character:Character = CH2.currentCharacter;
- if (character.buffs.hasBuffByName("Preparation"))
- {
- var currentBuff:Buff = character.buffs.getBuff("Preparation");
- currentBuff.stacks += 1;
- }
- else
- {
- var preparationBuff:Buff = new Buff();
- preparationBuff.name = "Preparation";
- preparationBuff.iconId = 90;
- preparationBuff.isUntimedBuff = true;
- preparationBuff.tickFunction = function() {
- if (preparationBuff.stacks <= 0) {
- preparationBuff.isFinished = true;
- }
- }
- preparationBuff.tooltipFunction = function() {
- return {
- "header": "Preparation",
- "body": "Current stacks: " + preparationBuff.stacks
- };
- }
- CH2.currentCharacter.buffs.addBuff(preparationBuff);
- }
- }
- public function applyPoisonDebuff(target:Monster, stacks:int):void
- {
- if (target)
- {
- var currentPoison:MonsterDebuff = target.getDebuff("Poison");
- if (currentPoison)
- {
- currentPoison.stacks += stacks;
- return;
- }
- var debuff:MonsterDebuff = new MonsterDebuff(target);
- var character:Character = CH2.currentCharacter;
- var poisonStacksLostPerTick:int = 5 - character.getTrait("Slow Poison");
- debuff.name = "Poison";
- debuff.isUntimedDebuff = true;
- debuff.isStackable = true;
- debuff.stacks += stacks;
- debuff.tickFunction = function() {
- var poisonDamageNumber:BigNumber = new BigNumber(character.clickDamage.multiplyN((0.08 + 0.01 * character.getTrait("Poison Damage")) * debuff.stacks));
- var poisonDamage:AttackData = new AttackData();
- poisonDamage.damage = poisonDamageNumber;
- target.takeDamage(poisonDamage);
- if (character.buffs.hasBuffByName("Splurt"))
- {
- debuff.stacks += 2;
- }
- else
- {
- debuff.stacks -= poisonStacksLostPerTick;
- }
- if (debuff.stacks <= 0)
- {
- debuff.isFinished = true;
- }
- var effect:GpuMovieClip = CH2AssetManager.instance.getGpuMovieClip("HelpfulAdventurer_bamplode1");
- effect.gotoAndPlay(1);
- effect.isLooping = false;
- CH2.world.addEffect(effect, CH2.world.roomsFront, target.x, target.y);
- }
- debuff.deathFunction = function() {
- var contagion:Number = character.getTrait("Contagion");
- if (contagion)
- {
- var nextTarget:Monster = CH2.world.getNextMonster();
- var stacksToTransfer:int = Math.floor(debuff.stacks * 0.1 * contagion);
- applyPoisonDebuff(nextTarget, stacksToTransfer);
- }
- }
- target.addDebuff(debuff);
- }
- }
- /*
- // Effect function referenced by exampleSkill
- public function exampleEffect():void {
- var monster:Monster = CH2.world.getNextMonster(); // Requires import models.Monster
- if (monster) {
- var attackData:AttackData = new AttackData(); // Requires import models.AttackData
- // Using a Trait
- var damage:Number;
- if (CH2.currentCharacter.getTrait("ExampleTrait")) {
- damage = 100 * (1 + CH2.currentCharacter.getTrait("ExampleTrait"));
- }
- else {
- damage = 100;
- }
- var damageNumber:BigNumber = new BigNumber(damage); // Requires import com.playsaurus.numbers.BigNumber
- attackData.damage = damageNumber;
- CH2.currentCharacter.attack(attackData);
- // Playing a Sound
- // Requires import heroclickerlib.managers.SoundManager
- SoundManager.instance.playSound("power_surge_activate");
- // Adding a Visual Effect
- // Requires import heroclickerlib.GpuMovieClip
- // Requires import heroclickerlib.managers.CH2AssetManager
- var effect:GpuMovieClip = CH2AssetManager.instance.getGpuMovieClip("HelpfulAdventurer_bamplode1");
- effect.gotoAndPlay(1);
- effect.isLooping = false;
- CH2.world.addEffect(effect, CH2.world.roomsFront, monster.x, monster.y);
- }
- }
- // Effect function referenced by buffExampleSkill
- public function buffExampleEffect():void {
- // Creating a Buff
- // Requires import models.Buff
- var buff:Buff = new Buff();
- buff.name = "Example Buff";
- buff.iconId = 200;
- buff.duration = 5000;
- buff.tickRate = 1000;
- buff.tickFunction = function() {
- CH2.currentCharacter.addEnergy(5);
- }
- buff.tooltipFunction = function() {
- return {
- "header": "Example Buff",
- "body": "Restoring " + (5 * CH2.currentCharacter.hasteRating).toFixed(2) + " energy per second."
- };
- }
- CH2.currentCharacter.buffs.addBuff(buff);
- }
- */
- //public function thiefAttack(attackData:AttackData):void
- public function attackOverride(attackData:AttackData):void
- {
- var character:Character = CH2.currentCharacter;
- character.attackDefault(attackData);
- if (attackData.monster.isAlive)
- {
- var offhandAttack:AttackData = new AttackData();
- if (CH2.roller.miscRoller.boolean(0.3 + 0.05 * character.getTrait("Offhand Accuracy")))
- {
- offhandAttack.damage = character.damage;
- offhandAttack.damage.timesEqualsN(0.3 + 0.05 * character.getTrait("Offhand Damage"));
- offhandAttack.isCritical = CH2.roller.attackRoller.boolean(character.criticalChance);
- if (offhandAttack.isCritical)
- {
- offhandAttack.damage.timesEqualsN(character.criticalDamageMultiplier);
- if (character.getTrait("Preparation") && !character.buffs.hasBuffByName("Prepared Haste"))
- {
- applyPreparationBuff();
- }
- }
- if (character.getTrait("Offhand Poison"))
- {
- if (CH2.roller.miscRoller.boolean(0.25 * character.getTrait("Offhand Poison")))
- {
- applyPoisonDebuff(attackData.monster,5);
- }
- }
- }
- else
- {
- offhandAttack.damage = new BigNumber(0);
- }
- attackData.monster.takeDamage(offhandAttack);
- }
- if (attackData.isCritical && character.getTrait("Preparation") && !character.buffs.hasBuffByName("Prepared Haste"))
- {
- applyPreparationBuff();
- }
- }
- //public function thiefOnKilledMonster(monster:Monster):void
- public function onKilledMonsterOverride(monster:Monster):void
- {
- var character = CH2.currentCharacter;
- if (character.getTrait("Bloopcoin Investment"))
- {
- if (!character.buffs.hasBuffByName("Bloopcoin Exchange Rate"))
- {
- applyExchangeRateBuff();
- }
- else
- {
- var rateChange:Number = CH2.roller.miscRoller.range(-0.05, 0.05);
- exchangeRate += rateChange;
- }
- }
- character.onKilledMonsterDefault(monster);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement