Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Salvaging through BlueprintIntel.java  (Read 653 times)

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Salvaging through BlueprintIntel.java
« on: October 23, 2021, 06:57:01 PM »

Code
			} else if (type.equals(Items.SHIP_BP)) {
WeightedRandomPicker<ShipHullSpecAPI> picker = new WeightedRandomPicker<ShipHullSpecAPI>(genRandom);
for (ShipHullSpecAPI spec : Global.getSettings().getAllShipHullSpecs()) {
if (!spec.hasTag(Items.TAG_RARE_BP)) continue;
if (spec.hasTag(Tags.NO_DROP)) continue;
if (Global.getSector().getPlayerFaction().knowsWeapon(spec.getHullId())) continue;
float w = spec.getRarity() * getQualityMultForTier(spec.getFleetPoints() / 6);;
picker.add(spec, w);
}
Salvaging through BlueprintIntel.java because I hate how this random entity is generated... Ship are weapons?

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Salvaging through BlueprintIntel.java
« Reply #1 on: October 23, 2021, 07:16:50 PM »

Ah, didn't see what you meant at first - thanks for letting me know; fixed this up.
Logged

ASSIMKO

  • Commander
  • ***
  • Posts: 158
    • View Profile
Re: Salvaging through BlueprintIntel.java
« Reply #2 on: December 04, 2021, 03:32:24 PM »

Code
			} else if (type.equals(Items.SHIP_BP)) {
WeightedRandomPicker<ShipHullSpecAPI> picker = new WeightedRandomPicker<ShipHullSpecAPI>(genRandom);
for (ShipHullSpecAPI spec : Global.getSettings().getAllShipHullSpecs()) {
if (!spec.hasTag(Items.TAG_RARE_BP)) continue;
if (spec.hasTag(Tags.NO_DROP)) continue;
if (Global.getSector().getPlayerFaction().knowsWeapon(spec.getHullId())) continue;
float w = spec.getRarity() * getQualityMultForTier(spec.getFleetPoints() / 6);;
picker.add(spec, w);
}
Salvaging through BlueprintIntel.java because I hate how this random entity is generated... Ship are weapons?


So how do you do it?
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3021
    • View Profile
Re: Salvaging through BlueprintIntel.java
« Reply #3 on: December 04, 2021, 04:10:50 PM »

Code: java
PlayerFaction().knowsWeapon(spec.getHullId())

lol
Logged