PageSourceSearch

https://sparticle999.github.io/SpaceCompany/star.js

js sparticle999.github.io collected 2026-10-03 09:59:04 UTC 1,686 bytes, 60 lines download raw bytes

1Game.interstellar.stars = (function(){
2
3    var instance = {};
4
5    instance.dataVersion = 1;
6    instance.entries = {};
7    instance.starCount = 0;
8
9    instance.systemsConquered = 0;
10    
11    instance.initialise = function() {
12        for (var id in Game.starData) {
13            var data = Game.starData[id];
14            
15            this.starCount++;
16            this.entries[id] = $.extend({}, data, {
17                id: id,
18                htmlId: 'star_' + id,
19                current: 0,
20                spy: 0,
21                explored: false,
22                owned: false,
23                displayNeedsUpdate: false,
24            });
25            
26        }
27
28        console.debug("Loaded " + this.starCount + " Stars");
29
30    };
31
32    instance.save = function(data) {
33        data.stars = { v: this.dataVersion, i: {}};
34        for(var key in this.entries) {
35            data.stars.i[key] = this.entries[key].current;
36        }
37    };
38
39    instance.exploreSystem = function(id){
40        if(Game.interstellar.rocket.entries.tier1Rocket.built == true){
41            var data = this.entries[id];
42            var exploreCost = data.distance * 10000;
43            if(antimatter >= exploreCost){
44                antimatter -= exploreCost;
45                data.explored = true;
46                document.getElementById('star_' + id).className = "hidden";
47                document.getElementById('star_' + id + '_conquer').className = "";
48                newNavUnlock('intnav_' + data.factionId);
49                data.displayNeedsUpdate = true;
50            }
51        }
52    };
53
54    instance.getStarData = function(id) {
55        return this.entries[id];
56    };
57    
58
59    return instance;
60}());

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.