Research cost multipliers for Serpulo resources

This commit is contained in:
Anuken
2021-12-28 16:36:04 -05:00
parent 4fa88296a7
commit 37bc06d14a
7 changed files with 43 additions and 13 deletions

View File

@@ -271,8 +271,6 @@ public class Block extends UnlockableContent{
public Effect destroyEffect = Fx.dynamicExplosion;
/** Multiplier for cost of research in tech tree. */
public float researchCostMultiplier = 1;
/** Multipliers for research costs on a per-item basis. Format: ID to multiplier. */
public ObjectFloatMap<Item> researchCostMultipliers = new ObjectFloatMap<>();
/** Whether this block has instant transfer.*/
public boolean instantTransfer = false;
/** Whether you can rotate this block after it is placed. */
@@ -869,7 +867,7 @@ public class Block extends UnlockableContent{
public ItemStack[] researchRequirements(){
ItemStack[] out = new ItemStack[requirements.length];
for(int i = 0; i < out.length; i++){
int quantity = 60 + Mathf.round(Mathf.pow(requirements[i].amount, 1.1f) * 20 * researchCostMultiplier * researchCostMultipliers.get(requirements[i].item, 1f), 10);
int quantity = 60 + Mathf.round(Mathf.pow(requirements[i].amount, 1.1f) * 20 * researchCostMultiplier, 10);
out[i] = new ItemStack(requirements[i].item, UI.roundAmount(quantity));
}

View File

@@ -133,6 +133,7 @@ public class ItemTurret extends Turret{
@Override
public void handleItem(Building source, Item item){
//TODO instead of all this "entry" crap, turrets could just accept only one type of ammo at a time - simpler for both users and the code
if(item == Items.pyratite){
Events.fire(Trigger.flameAmmo);