From cc0fc2acff7b656997277a55cd50d6d27e972807 Mon Sep 17 00:00:00 2001 From: Artefact2 Date: Fri, 11 Mar 2016 21:34:32 +0100 Subject: [PATCH] Fix: add even more modifierInfo cases. --- tools/bootstrap_from_json | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/tools/bootstrap_from_json b/tools/bootstrap_from_json index 202b06b..928f013 100755 --- a/tools/bootstrap_from_json +++ b/tools/bootstrap_from_json @@ -1,7 +1,7 @@ #!/usr/bin/env php + * Copyright (C) 2012, 2013, 2014, 2015, 2016 Romain "Artefact2" Dalmaso * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU Affero General Public License @@ -411,22 +411,30 @@ foreach($json['effects'] as &$effect) { ]); break; - case null: + case 'targetID': $domain = query_or_insert_expression($json, [ 'operandID' => 24, /* DEFENVIDX */ - 'expressionValue' => 'Self', + 'expressionValue' => 'Target', ]); break; - case 'targetID': + case 'otherID': $domain = query_or_insert_expression($json, [ 'operandID' => 24, /* DEFENVIDX */ - 'expressionValue' => 'Target', + 'expressionValue' => 'Other', + ]); + break; + + case 'itemID': + case null: + $domain = query_or_insert_expression($json, [ + 'operandID' => 24, /* DEFENVIDX */ + 'expressionValue' => 'Self', ]); break; default: - var_dump($effect); + echo $effect['modifierInfo']."\n"; fatal("modifierInfo has unknown domain: ".$modifier['domain']); } @@ -475,7 +483,7 @@ foreach($json['effects'] as &$effect) { break; default: - var_dump($effect); + echo $effect['modifierInfo']."\n"; fatal("modifierInfo has unknown func: ".$modifier['func']); } @@ -503,6 +511,11 @@ foreach($json['effects'] as &$effect) { $assocstring = 'ModAdd'; break; + case 4: + /* XXX: this is REALLY guesswork */ + $assocstring = 'PostMul'; + break; + case 5: $assocstring = 'PostDiv'; break; @@ -517,7 +530,7 @@ foreach($json['effects'] as &$effect) { break; default: - var_dump($effect); + echo $effect['modifierInfo']."\n"; fatal("modifierInfo has unknown operator: ".$modifier['operator']); }