Skip to content
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.

Commit

Permalink
Fix: add even more modifierInfo cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
Artefact2 committed Mar 11, 2016
1 parent 5ae2675 commit cc0fc2a
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions tools/bootstrap_from_json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php
/* libdogma
* Copyright (C) 2012, 2013, 2014, 2015 Romain "Artefact2" Dalmaso <[email protected]>
* Copyright (C) 2012, 2013, 2014, 2015, 2016 Romain "Artefact2" Dalmaso <[email protected]>
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
Expand Down Expand Up @@ -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']);

}
Expand Down Expand Up @@ -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']);

}
Expand Down Expand Up @@ -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;
Expand All @@ -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']);

}
Expand Down

0 comments on commit cc0fc2a

Please sign in to comment.