silkedit 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c84c630a7a0da05c4ac2f304f461cbafb290a66ff589bced25ec0ad894fb8eaa
4
- data.tar.gz: 5243af655c84d359830f15beb18627c4530a82aed983b7484b6df249ce2fa579
3
+ metadata.gz: a7f3339a4438bd794c4ed860bba4216a0b4bb018fdaa570d72f66e69388e975a
4
+ data.tar.gz: d4a14494a7d827fd61c91e48f3b98500fc9c072f5718da7e504a14fc7f0ecb4c
5
5
  SHA512:
6
- metadata.gz: 1fbc1f2f828e0be815316b3e2bb0430f603e67eb2e6c64c8ac6cc4bfff3785ee430f83531d8c8ad673717e2444f42a2015a2046f37372afb6e625810d186404c
7
- data.tar.gz: 98f0b8ac23d6e6f153dc17f719c9994f3a04c2f7358569a20428687485598e15da4c8e7d0ec4b0ce54d8f8f059d51506599327203eebf0e2b2ea64584fe751a1
6
+ metadata.gz: dc0d913626bbe4eb89b3b7d684642202ccbe02b73de78d5bfacf6cd11ed034a922e4c8011acb31a57b23c5f84b5d409babf7f91cb888462833783c47c3ac4134
7
+ data.tar.gz: 5b4ee244c35db3d4eec09e6202f450f9681edfbec1a2c25d81ae3f27a3e3b724c9924dfbe78c3296cdeb8173ace4c698346943af8305550e67dac7e308e77ce9
@@ -1,10 +1,10 @@
1
1
  Rbcli.command 'journal' do
2
2
  description 'Manages the journal of enemy kills'
3
- usage '[list|listmissing|complete|killsonly]'
3
+ usage '[listall|listmissing|complete|killsonly]'
4
4
  parameter :showimages, 'Show images of the enemies', short: 'i', type: :bool, default: false
5
5
  action do |opts, params, args, config, env|
6
6
  command = args.first
7
- if command.nil? || command.empty? || !%w[list listmissing complete killsonly].include?(command)
7
+ if command.nil? || command.empty? || !%w[listall listmissing complete killsonly].include?(command)
8
8
  Rbcli.log.error "Must specify an action as one of: listall, listmissing, complete, killsonly"
9
9
  next
10
10
  end
@@ -27,7 +27,7 @@ Rbcli.command 'journal' do
27
27
  s.direct_backup
28
28
  s.save_to_dat
29
29
  else
30
- raise "Unknown command: #{command}"
30
+ Rbcli.fatal "Unknown command: #{command}", exit_status: 1
31
31
  end
32
32
 
33
33
  end
data/lib/config/parser.rb CHANGED
@@ -29,6 +29,6 @@ Rbcli::Configurate.cli do
29
29
  # multi: If set to true, allows the option to be provided multiple times (--param --param, or in short form, -pp). (Default: false)
30
30
  # When using this with a :boolean type, rather than returning `true` or `false`, it will return a count of the number of times the parameter was passed.
31
31
  # permitted: If set to an array, restricts input to the values within that array. (Default: nil (no restrictions))
32
- opt :verbose, "Twice or more enables very-verbose output", multi: true
32
+ # opt :verbose, "Twice or more enables very-verbose output", multi: true
33
33
  opt :savenum, "A number from 1-4, indicating which game save you'd like to address", short: 's', type: :integer
34
34
  end
@@ -31,7 +31,7 @@ module Silkedit::Cheat
31
31
  merge_hash(data[k], cheat[k])
32
32
  elsif should_merge_arrays && cheat[k].is_a?(Array) && data[k].is_a?(Array)
33
33
  if cheat[k][0].is_a?(Hash)
34
- merge_arrays_by_hash_keys(data[k], cheat[k])
34
+ data[k] = merge_arrays_by_hash_keys(data[k], cheat[k])
35
35
  else
36
36
  data[k].merge!(cheat[k])
37
37
  data[k].uniq!
@@ -44,7 +44,11 @@ module Silkedit::Cheat
44
44
  end
45
45
 
46
46
  def self.merge_arrays_by_hash_keys(data, cheat)
47
- return nil unless data.is_a?(Array) && cheat.is_a?(Array) && data.first.is_a?(Hash)
47
+ return data unless data.is_a?(Array) && cheat.is_a?(Array) && cheat.first.is_a?(Hash)
48
+ if data.empty?
49
+ data = cheat
50
+ return data
51
+ end
48
52
  # First determine the primary key(s) for the object
49
53
  pkeys = []
50
54
  [%w[Name], %w[sceneData ID]].each do |pkey_arr|
@@ -58,7 +62,7 @@ module Silkedit::Cheat
58
62
  data << c
59
63
  end
60
64
  end
61
- true
65
+ data
62
66
  end
63
67
 
64
68
  def self.verify_hash(data, reqs)
@@ -117,5 +117,11 @@ module Silkedit::Cheat
117
117
  Rbcli.log.info "Toggling permadeath mode #{toggle ? 'ON' : 'OFF'}", 'CHEATS'
118
118
  @data['playerData']['permadeathMode'] = toggle ? 1 : 0
119
119
  end
120
+
121
+ def toggle_fly_mode
122
+ toggle = @data['playerData']['infiniteAirJump'] == false
123
+ Rbcli.log.info "Toggling fly mode #{toggle ? 'ON' : 'OFF'}", 'CHEATS'
124
+ @data['playerData']['infiniteAirJump'] = toggle ? true : false
125
+ end
120
126
  end
121
127
  end
@@ -8,8 +8,8 @@ module Silkedit::Cheat
8
8
  def update_journal(should_update_kills_only: true)
9
9
  enemylist = Silkedit::Cheat::SilksongJournaler.module_eval { @enemylist }
10
10
  Rbcli.log.info 'Applying ', 'JOURNAL'
11
- enemylist['playerData']['EnemyJournalKillData']['list'].each do |known_enemy|
12
- sleep 0.05
11
+ enemylist['playerData']['EnemyJournalKillData']['list'].sort_by { |known_enemy| known_enemy['Position']}.each do |known_enemy|
12
+ sleep 0.01
13
13
  player_enemy = @data['playerData']['EnemyJournalKillData']['list'].find { |i| i['Name'] == known_enemy['Name'] }
14
14
  self.display_enemy(known_enemy, player_enemy, show_images: false)
15
15
  if player_enemy.nil?
@@ -38,7 +38,7 @@ module Silkedit::Cheat
38
38
 
39
39
  def enemy_list(only_missing: false, show_images: false)
40
40
  enemylist = Silkedit::Cheat::SilksongJournaler.module_eval { @enemylist }
41
- enemylist['playerData']['EnemyJournalKillData']['list'].each do |known_enemy|
41
+ enemylist['playerData']['EnemyJournalKillData']['list'].sort_by { |known_enemy| known_enemy['Position']}.each do |known_enemy|
42
42
  player_enemy = @data['playerData']['EnemyJournalKillData']['list'].find { |i| i['Name'] == known_enemy['Name'] }
43
43
  left = player_enemy.nil? ? known_enemy['Record']['Kills'] : known_enemy['Record']['Kills'] - player_enemy['Record']['Kills']
44
44
  left = 0 if left < 0
@@ -54,12 +54,13 @@ module Silkedit::Cheat
54
54
  left = player_enemy.nil? ? known_enemy['Record']['Kills'] : known_enemy['Record']['Kills'] - player_enemy['Record']['Kills']
55
55
  left = 0 if left < 0
56
56
  e_complete = left <= 0 ? '*'.colorize(:cyan) : ' '
57
+ e_number = known_enemy['Position'].to_s.rjust(3)
57
58
  e_name = known_enemy['GameName'].ljust(27).colorize(:blue).bold
58
59
  e_seen = player_enemy.nil? ? 'N'.colorize(:red) : 'Y'.colorize(:green)
59
60
  e_kills = (player_enemy.nil? ? 0 : player_enemy['Record']['Kills']).to_s.rjust(4).colorize(:green)
60
61
  e_req = known_enemy['Record']['Kills'].to_s.rjust(4).colorize(:blue)
61
62
  e_need = left.to_s.rjust(4).colorize(left <= 0 ? :cyan : :red)
62
- Rbcli.log.info "#{e_complete} #{e_name} Seen? #{e_seen} Kills: #{e_kills} Needed: #{e_req} Left: #{e_need}"
63
+ Rbcli.log.info "#{e_number}. #{e_complete} #{e_name} Seen? #{e_seen} Kills: #{e_kills} Needed: #{e_req} Left: #{e_need}"
63
64
  end
64
65
 
65
66
  def show_enemy_image(name)
@@ -770,6 +770,58 @@ cheats:
770
770
  Amount: 1
771
771
  IsSeenMask: 0
772
772
  AmountWhileHidden: 0
773
+ ability_dash:
774
+ data:
775
+ playerData:
776
+ hasDash: true
777
+ HasSeenDash: true
778
+ ability_doublejump:
779
+ data:
780
+ playerData:
781
+ hasDoubleJump: true
782
+ ability_drift:
783
+ data:
784
+ playerData:
785
+ hasBrolly: true
786
+ ability_walljump:
787
+ data:
788
+ playerData:
789
+ hasWalljump: true
790
+ HasSeenWalljump: true
791
+ ability_needolin:
792
+ data:
793
+ playerData:
794
+ hasNeedolin: true
795
+ HasSeenNeedolin: true
796
+ ability_needolin_up:
797
+ data:
798
+ playerData:
799
+ hasNeedolinMemoryPowerup: true
800
+ HasSeenNeedolinUp: true
801
+ ability_needolin_down:
802
+ data:
803
+ playerData:
804
+ UnlockedFastTravelTeleport: true
805
+ HasSeenNeedolinDown: true
806
+ ability_harpoon:
807
+ data:
808
+ playerData:
809
+ hasHarpoonDash: true
810
+ HasSeenHarpoon: true
811
+ ability_charge_weapon:
812
+ data:
813
+ playerData:
814
+ hasChargeSlash: true
815
+ ability_silkspecial:
816
+ data:
817
+ playerData:
818
+ hasSilkSpecial: true
819
+ HasSeenSilkSpecial: true
820
+ ability_superjump:
821
+ data:
822
+ playerData:
823
+ hasSuperJump: true
824
+ HasSeenSuperJump: true
773
825
  quill_none:
774
826
  data:
775
827
  playerData: