Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- import java.util.ArrayList;
- public class PledgeSimulation
- {
- private double cookiesGained;
- private int clicksPerSecond;
- private int time;
- private int frenzyMult;
- private int frenzyTime;
- private String effect;
- private String lastEffect;
- private Random RNGesus;
- public PledgeSimulation(int clicksPerSecond)
- {
- this.clicksPerSecond = clicksPerSecond;
- this.lastEffect = null;
- this.frenzyMult = 1;
- RNGesus = new Random();
- }
- public String getEffect(String previousEffect)
- {
- ArrayList<String> possibleEffects = new ArrayList<String>();
- possibleEffects.add("lucky");
- possibleEffects.add("frenzy");
- if(Math.random()<0.15) possibleEffects.add("dragonflight");
- if(Math.random()<0.1) possibleEffects.add("click frenzy");
- if(Math.random()<0.03) possibleEffects.add("cookie chain");
- for(int i=0; i<possibleEffects.size(); i++)
- {
- if(possibleEffects.get(i).equals(previousEffect) && Math.random()<0.8) possibleEffects.remove(i);
- }
- String nextEffect = possibleEffects.get(RNGesus.nextInt(possibleEffects.size()));
- effect = nextEffect;
- return effect;
- }
- public String getLastEffect()
- {
- return lastEffect;
- }
- public double getCookiesGained()
- {
- return cookiesGained;
- }
- public void idle()
- {
- cookiesGained += frenzyMult;
- if(frenzyTime>0) frenzyTime--;
- if(frenzyTime==0) frenzyMult = 1;
- }
- public void simulate(String gcEffect)
- {
- if(gcEffect.equals("lucky")) cookiesGained += 900*frenzyMult;
- if(gcEffect.equals("frenzy"))
- {
- frenzyMult = 7;
- frenzyTime = 170;
- }
- if(gcEffect.equals("dragonflight")) cookiesGained += 1111*frenzyMult*0.09*1.1*1.1*1.1*22*clicksPerSecond;
- if(gcEffect.equals("click frenzy")) cookiesGained += 777*frenzyMult*0.09*1.1*1.1*1.1*28.6*clicksPerSecond;
- if(gcEffect.equals("cookie chain"))
- {
- if(frenzyMult==7) cookiesGained += 3600*42;
- else cookiesGained += 3600*4.2;
- }
- lastEffect = gcEffect;
- }
- public static void main(String[] args)
- {
- PledgeSimulation simulation = new PledgeSimulation(10);
- for(int i=0; i<365*86400; i++)
- {
- simulation.idle();
- if(i%95==0) simulation.simulate(simulation.getEffect(simulation.getLastEffect()));
- }
- System.out.print("Earned "+simulation.getCookiesGained()*1.05+" times base CPS.");
- }
- }
- -----------------------------------------------------------------------------------------------------------
- import java.util.Random;
- import java.util.ArrayList;
- public class OneMindSimulation
- {
- private double cookiesGained;
- private int clicksPerSecond;
- private int time;
- private double frenzyMult;
- private int frenzyTime;
- private String effect;
- private String lastEffect;
- private Random RNGesus;
- public OneMindSimulation(int clicksPerSecond)
- {
- this.clicksPerSecond = clicksPerSecond;
- this.lastEffect = null;
- this.frenzyMult = 1;
- RNGesus = new Random();
- }
- public String getEffect(String previousEffect)
- {
- ArrayList<String> possibleEffects = new ArrayList<String>();
- if(Math.random()<0.66)
- {
- possibleEffects.add("lucky");
- possibleEffects.add("frenzy");
- if(Math.random()<0.15) possibleEffects.add("dragonflight");
- if(Math.random()<0.1) possibleEffects.add("click frenzy");
- if(Math.random()<0.03) possibleEffects.add("cookie chain");
- }
- else
- {
- possibleEffects.add("clot");
- possibleEffects.add("ruin");
- possibleEffects.add("lucky");
- if(Math.random()<0.05) possibleEffects.add("dragonflight");
- if(Math.random()<0.1) possibleEffects.add("click frenzy");
- if(Math.random()<0.3)
- {
- possibleEffects.add("elder frenzy");
- possibleEffects.add("cookie chain");
- }
- }
- for(int i=0; i<possibleEffects.size(); i++)
- {
- if(possibleEffects.get(i).equals(previousEffect) && Math.random()<0.8) possibleEffects.remove(i);
- }
- String nextEffect = possibleEffects.get(RNGesus.nextInt(possibleEffects.size()));
- effect = nextEffect;
- return effect;
- }
- public String getLastEffect()
- {
- return lastEffect;
- }
- public double getCookiesGained()
- {
- return cookiesGained;
- }
- public void idle()
- {
- cookiesGained += frenzyMult*9.1318;
- if(frenzyTime>0) frenzyTime--;
- if(frenzyTime==0) frenzyMult = 1;
- }
- public void reindeer()
- {
- cookiesGained += 120*frenzyMult;
- }
- public void simulate(String gcEffect)
- {
- if(gcEffect.equals("lucky")) cookiesGained += 900*frenzyMult;
- if(gcEffect.equals("frenzy"))
- {
- frenzyMult = 7;
- frenzyTime = 170;
- }
- if(gcEffect.equals("clot"))
- {
- frenzyMult = 0.5;
- frenzyTime = 145;
- }
- if(gcEffect.equals("elder frenzy"))
- {
- frenzyMult = 666;
- frenzyTime = 13;
- cookiesGained += 666*0.09*1.1*1.1*1.1*13*clicksPerSecond;
- }
- if(gcEffect.equals("dragonflight")) cookiesGained += 1111*frenzyMult*0.09*1.1*1.1*1.1*22*clicksPerSecond;
- if(gcEffect.equals("click frenzy")) cookiesGained += 777*frenzyMult*0.09*1.1*1.1*1.1*28.6*clicksPerSecond;
- if(gcEffect.equals("cookie chain"))
- {
- if(frenzyMult==7) cookiesGained += 3600*42;
- else cookiesGained += 3600*4.2;
- }
- lastEffect = gcEffect;
- }
- public static void main(String[] args)
- {
- OneMindSimulation simulation = new OneMindSimulation(250);
- for(int i=0; i<365*86400; i++)
- {
- simulation.idle();
- if(i%100==0) simulation.simulate(simulation.getEffect(simulation.getLastEffect()));
- if(i%100==1) simulation.reindeer();
- }
- System.out.print("Earned "+simulation.getCookiesGained()+" times base CPS.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment