Git Product home page Git Product logo

skilltree's People

Contributors

z-doctor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

skilltree's Issues

Create a Json system to add trees.

Planned functionality of skills created this way:

  • Be able to position, have item icons and or custom background or png

  • Have parents, use skill point requirements, use level requirement and check for items like skill do

  • Be able to awards players items, points (perhaps run a command), attribute modifiers or potion effects

Stackable skills

A skill that can be bought multiple times and do different things based on skill tier (how many times it is bought).

Is this a SkillTree issue?

Died in my game then the game crashed, tried to log back in and my console spammed:

[15:24:43] [Server thread/WARN] [FML]: * Receiver EntityPlayerMP['Beanius'/26542, l='Biome Bundle', x=-295.36, y=151.95, z=-308.64] is Dead!
[15:24:43] [Server thread/WARN] [FML]: * at zdoctor.skilltree.api.SkillTreeApi.syncSkills(SkillTreeApi.java:178)
[15:24:43] [Server thread/WARN] [FML]: * at zdoctor.skilltree.skills.CapabilitySkillHandler.playerTracking(CapabilitySkillHandler.java:114)
[15:24:43] [Server thread/WARN] [FML]: * at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_1577_CapabilitySkillHandler_playerTracking_StartTracking.invoke(.dynamic)
[15:24:43] [Server thread/WARN] [FML]: * at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
[15:24:43] [Server thread/WARN] [FML]: * at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
[15:24:43] [Server thread/WARN] [FML]: * at net.minecraftforge.event.ForgeEventFactory.onStartEntityTracking(ForgeEventFactory.java:367)...
[15:24:43] [Server thread/WARN] [FML]: ****************************************

while nothing else happened

Client-Server Sync

The client is not automatically syncing to the server on join in single player worlds

Free child skills

After buying the first parent skill in a group of skills all subsequent skills in the group becomes free. Posting code here since I'm using your template:

public class AttackSpeed extends AttackSpeedSkill {
	public static final String[] NAME = new String[] { "atkSpeedI", "atkSpeedII", "atkSpeedIII", "atkSpeedIV" };
	public static final Item[] ICON = new Item[] { Items.WOODEN_SWORD, Items.STONE_SWORD, Items.IRON_SWORD, Items.DIAMOND_SWORD};

	public static final SkillAttributeModifier[] MODIFIERS = new SkillAttributeModifier[4];

	protected static int TIER;

	protected final int tier;
	
	public AttackSpeed() {
		super(NAME[(TIER = TIER >= NAME.length ? 0 : TIER)], ICON[TIER]);
		this.tier = TIER;
		this.addRequirement(new SkillPointRequirement(tier));

		MODIFIERS[TIER] = new SkillAttributeModifier("attackSkill." + NAME[TIER], 1, 0);

		TIER++;
	}
	
	@Override
	public SkillAttributeModifier getModifier(EntityLivingBase entity, SkillBase skill) {
		if (skill instanceof AttackSpeed)
			return MODIFIERS[((AttackSpeed) skill).getTier()];
		return null;
	}

	public int getTier() {
		return this.tier;
	}
	
	@Override
	public List<ISkillRequirment> getRequirments(EntityLivingBase entity, boolean hasSkill) {
		return Collections.singletonList(new LevelRequirement(3+tier*3));
	}
	
}

public class AttackSkillPage extends SkillPageBase {

	private DoubleDamage doubleDamage;
	private ExtraDamage extraDamage;
	private ExtraDamage extraDamage1;
	private ExtraDamage extraDamage2;
	private ExtraDamage extraDamage3;
	private ExtraDamage extraDamage4;
	private ExtraDamage extraDamage5;
	private AttackSpeed attackSpeed;
	private AttackSpeed attackSpeed1;
	private AttackSpeed attackSpeed2;
	private AttackSpeed attackSpeed3;

	private SwordProficiency swordProficiency;
	private AxeProficiency axeProficiency;

	public AttackSkillPage() {
		super("AttackPage");
	}

	@Override
	public void registerSkills() {
		extraDamage = new ExtraDamage();
		extraDamage1 = (ExtraDamage) new ExtraDamage().setParent(extraDamage);
		extraDamage2 = (ExtraDamage) new ExtraDamage().setParent(extraDamage1);
		extraDamage3 = (ExtraDamage) new ExtraDamage().setParent(extraDamage2);
		extraDamage4 = (ExtraDamage) new ExtraDamage().setParent(extraDamage3);
		extraDamage5 = (ExtraDamage) new ExtraDamage().setParent(extraDamage4);
		doubleDamage = (DoubleDamage) new DoubleDamage().setParent(extraDamage4);
		attackSpeed = new AttackSpeed();
		attackSpeed1 = (AttackSpeed) new AttackSpeed().setParent(attackSpeed);
		attackSpeed2 = (AttackSpeed) new AttackSpeed().setParent(attackSpeed1);
		attackSpeed3 = (AttackSpeed) new AttackSpeed().setParent(attackSpeed2);

		swordProficiency = new SwordProficiency();
		axeProficiency = new AxeProficiency();
	}

	@Override
	public void loadPage() {
		addSkill(extraDamage, 0, 0);
		addSkill(extraDamage1, 1, 0);
		addSkill(extraDamage2, 2, 0);
		addSkill(extraDamage3, 3, 0);
		addSkill(extraDamage4, 4, 0);
		addSkill(extraDamage5, 5, 0);
		addSkill(doubleDamage, 5, 1);
		
		addSkill(attackSpeed, 0, 2);
		addSkill(attackSpeed1, 1, 2);
		addSkill(attackSpeed2, 2, 2);
		addSkill(attackSpeed3, 3, 2);

		addSkill(swordProficiency, 0, 5);
		addSkill(axeProficiency, 1, 5);
	}

	@Override
	public BackgroundType getBackgroundType() {
		return BackgroundType.NETHERRACK;
	}

}

Attributes only in Int

SkillAttributeModifier only takes Int instead of float, this means that you can't do percentage increases, unless I need to use a different function? Still, I'd recommend changing it to a float.

Personally, I'm trying to increase attack speed, but only being able to increase it by +1 or *2 (or any other whole number), isn't that useful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.