Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# https://EditorConfig.org

root = true

[*]
charset = utf-8
#insert_final_newline = true
#trim_trailing_whitespace = true

[*.{py,pyx}]
indent_style = tab
indent_size = 4
71 changes: 71 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Test Deployment

on:
push:
pull_request:

jobs:
bundle:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, macos-10.15, windows-2019]
fail-fast: false
steps:
# Must checkout with v1 so that git describe will work correctly.
# https://github.com/actions/checkout/issues/290
- uses: actions/checkout@v1
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
# Python 3.8 is the last version with Windows 7 support.
python-version: "3.8"
- name: Install APT dependencies
# python-tcod needs libsdl2-dev to build on Linux.
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install libsdl2-dev
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Pip packages
run: |
python -m pip install -U pip wheel
pip install -r requirements.txt
- name: Compile Cython modules
run: |
python compile_cython_modules.py build_ext --inplace
- name: Run PyInstaller
env:
PYTHONOPTIMIZE: 1 # Enable optimizations as if the -O flag is given.
PYTHONHASHSEED: 42 # Try to ensure deterministic results.
run: |
pyinstaller build.spec
- name: List files
shell: bash
run: |
find dist
- name: Tar files
if: runner.os != 'Windows'
run: |
tar --format=ustar -czvf ${{matrix.os}}.tar.gz dist/reactor-3
- name: Archive files
if: runner.os == 'Windows'
run: |
Compress-Archive dist/reactor-3 ${{matrix.os}}.zip
- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
with:
name: dist
path: ${{matrix.os}}.*
retention-days: 30
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.pyd
*.pyc
*.pyo
*.c
*.so
*.sh
Expand Down
3 changes: 3 additions & 0 deletions alife/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
# Ended: Probably not for a while #
###################################

# The use of star imports is causing hidden imports of submodules.
# Changing __all__ will break distributions unless the spec file is updated as well.

__all__ = ['action', 'snapshots', 'judgement', 'chunks', 'brain', 'speech', 'stances', 'jobs', 'groups', 'factions', 'camps', 'sight', 'rawparse', 'noise', 'planner']
24 changes: 12 additions & 12 deletions alife/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import life as lfe

import judgement
import movement
import rawparse
import goals
from . import judgement
from . import movement
from . import rawparse
from . import goals

import logging

Expand All @@ -17,7 +17,7 @@ def retrieve(match, **kwargs):
if 'list' in match:
return match['list']

print 'Match returned nothing!'*25
print('Match returned nothing!'*25)
#if 'criteria_id' in kwargs:
# _criteria = goals.get_criteria(life, )

Expand Down Expand Up @@ -112,7 +112,7 @@ def _execute(action):
if 'add_to' in _struct:
if not _struct['list'][0] in _struct['list']:
_struct['add_to'].append(_struct['list'][0])
print 'LOOK OUT!' * 55, _struct['add_to']
print('LOOK OUT!' * 55, _struct['add_to'])

return True

Expand All @@ -138,7 +138,7 @@ def _execute(action):
if 'filter' in action['args']:
_ret_list = []

for key in _arguments.keys():
for key in list(_arguments.keys()):
if not key in action['kwargs']['arguments']['kwargs']:
if 'include' in action['kwargs']['arguments']['kwargs'] and key in action['kwargs']['arguments']['kwargs']['include']:
continue
Expand All @@ -154,11 +154,11 @@ def _execute(action):
for entry in _ret_list:
_struct['list'].remove(entry)

print 'filter function',_struct['list']
print('filter function',_struct['list'])
return _struct['list']

if 'get_known_alife' in action['args']:
return _struct['life']['know'].keys()
return list(_struct['life']['know'].keys())

if 'track_alife' in action['args']:
if not _struct['list']:
Expand All @@ -167,11 +167,11 @@ def _execute(action):
if movement._find_alife(_struct['life'], target=_struct['list'][0]):
if not _struct['list'][0] in _struct['add_to']:
_struct['add_to'].append(_struct['list'][0])
print 'FOUND HIM!!!!!!!!!!!' * 50
print('FOUND HIM!!!!!!!!!!!' * 50)

lfe.focus_on(_struct['life'])
print _struct['life']['name'],'Tracking',LIFE[_struct['list'][0]]['name']
print judgement.can_trust(_struct['life'], _struct['list'][0])
print(_struct['life']['name'],'Tracking',LIFE[_struct['list'][0]]['name'])
print(judgement.can_trust(_struct['life'], _struct['list'][0]))

return True

Expand Down
16 changes: 8 additions & 8 deletions alife/alife_combat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
import graphics as gfx
import life as lfe

import judgement
from . import judgement
import bad_numbers
import combat
import speech
import sight
import camps
import brain
import stats
from . import combat
from . import speech
from . import sight
from . import camps
from . import brain
from . import stats
import logic
import jobs
from . import jobs

import logging

Expand Down
8 changes: 4 additions & 4 deletions alife/alife_cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import life as lfe

import judgement
import movement
from . import judgement
from . import movement
import bad_numbers
import sight
import brain
from . import sight
from . import brain

import logging

Expand Down
10 changes: 5 additions & 5 deletions alife/alife_discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import life as lfe

import judgement
import survival
import chunks
import sight
import brain
from . import judgement
from . import survival
from . import chunks
from . import sight
from . import brain
import smp

import logging
Expand Down
8 changes: 4 additions & 4 deletions alife/alife_escape.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import life as lfe

import judgement
import movement
import sight
import brain
from . import judgement
from . import movement
from . import sight
from . import brain

import logging

Expand Down
10 changes: 5 additions & 5 deletions alife/alife_explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

import life as lfe

import judgement
import survival
import chunks
import sight
import brain
from . import judgement
from . import survival
from . import chunks
from . import sight
from . import brain

import logging

Expand Down
6 changes: 3 additions & 3 deletions alife/alife_follow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import life as lfe

import judgement
import movement
import sight
from . import judgement
from . import movement
from . import sight


def tick(life):
Expand Down
16 changes: 8 additions & 8 deletions alife/alife_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

import life as lfe

import judgement
import movement
import groups
import speech
import action
from . import judgement
from . import movement
from . import groups
from . import speech
from . import action
import events
import brain
import stats
import jobs
from . import brain
from . import stats
from . import jobs


def setup(life):
Expand Down
6 changes: 3 additions & 3 deletions alife/alife_guard.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import life as lfe

import judgement
import movement
import brain
from . import judgement
from . import movement
from . import brain

import logging

Expand Down
6 changes: 3 additions & 3 deletions alife/alife_hidden.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import life as lfe

import judgement
import movement
import combat
from . import judgement
from . import movement
from . import combat

import logging

Expand Down
4 changes: 2 additions & 2 deletions alife/alife_manage_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import life as lfe

import judgement
import survival
from . import judgement
from . import survival

import logging

Expand Down
2 changes: 1 addition & 1 deletion alife/alife_manage_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import life as lfe

import alife
import raids
from . import raids

TIER = TIER_PASSIVE

Expand Down
10 changes: 5 additions & 5 deletions alife/alife_needs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

import life as lfe

import judgement
import movement
import survival
import brain
from . import judgement
from . import movement
from . import survival
from . import brain


def setup(life):
_needs_to_meet = []
_needs_to_satisfy = []
_needs_unmet = []

for need in life['needs'].values():
for need in list(life['needs'].values()):
if not survival.needs_to_satisfy(life, need):
continue

Expand Down
14 changes: 7 additions & 7 deletions alife/alife_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import life as lfe

import judgement
import movement
from . import judgement
from . import movement
import bad_numbers
import speech
import camps
import brain
import jobs
from . import speech
from . import camps
from . import brain
from . import jobs

import logging

Expand All @@ -27,7 +27,7 @@ def conditions(life, alife_seen, alife_not_seen, targets_seen, targets_not_seen,
if not _lost_targets:
return False
else:
print life['name'], _lost_targets
print(life['name'], _lost_targets)

return RETURN_VALUE

Expand Down
Loading