Пример #1
0
/* ring functions */
void i_perm_knowledge(pob o)
{
  if (o->known < 1)
    o->known = 1;
  if (o->blessing > -1)
    Objects[o->id].known = 1;
/* DAG hack for mirror of self-knowledge
  if (o->used)
    knowledge(o->blessing);
*/
  knowledge(o->blessing);
}
Пример #2
0
int ACE_TMAIN (int argc, ACE_TCHAR * argv[])
{
  settings.hosts.resize (1);
  settings.hosts[0] = default_multicast;
  int retcode = parse_args (argc, argv);

  // set type to multicast and change queue length to 512K
  settings.type = madara::transport::MULTICAST;
  settings.queue_length = 1024000;
  madara::knowledge::WaitSettings wait_settings;
  wait_settings.max_wait_time = 10;
  wait_settings.poll_frequency = 1.0;

  if (settings.id == 1)
  {
    wait_settings.pre_print_statement = 
      "Waiting on an_xml to change from process.id==1...\n";
  }

  if (retcode < 0)
    return retcode;

  ACE_LOG_MSG->priority_mask (LM_INFO | LM_DEBUG, ACE_Log_Msg::PROCESS);

  ACE_TRACE (ACE_TEXT ("main"));

  madara::knowledge::KnowledgeBase knowledge ("", settings);
  
  knowledge.set (".id", (madara::knowledge::KnowledgeRecord::Integer) settings.id);
  
  // run tests
//  test_tree_compilation (knowledge);
  if (settings.id == 0)
    read_and_create_files (knowledge);
  else
  {
    madara::utility::wait_true (knowledge,
      "finished_transmitting", wait_settings);
    write_transported_files (knowledge);
  }

  //knowledge.print ();

  return 0;
}
Пример #3
0
int main(int argc, char* argv[])
{
  settings.hosts.resize(1);
  settings.hosts[0] = default_multicast;
  int retcode = parse_args(argc, argv);

  // set type to multicast and change queue length to 512K
  settings.type = madara::transport::MULTICAST;
  settings.queue_length = 512000;
  madara::knowledge::WaitSettings wait_settings;
  wait_settings.max_wait_time = 10;
  wait_settings.poll_frequency = 1.0;
  wait_settings.delay_sending_modifieds = false;

  if (settings.id == 1)
  {
    wait_settings.pre_print_statement =
        "Waiting on finished_transmitting to change from process.id==1...\n";
  }

  if (retcode < 0)
    return retcode;

  madara::knowledge::KnowledgeBase knowledge("", settings);

  knowledge.set(".id", (madara::knowledge::KnowledgeRecord::Integer)settings.id,
      madara::knowledge::EvalSettings::SEND);

  // run tests
  //  test_tree_compilation (knowledge);
  if (settings.id == 0)
    create_arrays(knowledge);
  else
  {
    utility::wait_true(knowledge, "finished_transmitting", wait_settings);
    write_transported_arrays(knowledge);
  }

  // knowledge.print ();

  return 0;
}
Пример #4
0
void s_knowledge(void)
{
    knowledge(0);
}
Пример #5
0
void i_knowledge(pob o)
{
    if (o->blessing > -1)
        Objects[o->id].known = 1;
    knowledge(o->blessing);
}
Пример #6
0
void l_oracle(void)
{
    char response;
    if (gamestatusp(ATTACKED_ORACLE) && (! gamestatusp(COMPLETED_ASTRAL))) {
        print1("You come before a blue crystal dais. You see a broken mirror.");
        print2("Look in the mirror? [yn] ");
        if (ynq2()=='y') {
            print1("A strange force rips you from your place....");
            Player.hp = 1;
            print2("You feel drained....");
            dataprint();
            print3("You find yourself in a weird flickery maze.");
            change_environment(E_ASTRAL);
        }
    }
    else {
        print1("You come before a blue crystal dais. There is a bell and a mirror.");
        print2("Ring the bell [b], look in the mirror [m], or leave [ESCAPE] ");
        do response = (char) mcigetc();
        while ((response != 'b') && (response != 'm') && (response != ESCAPE));
        if (response == 'b') {
            print1("The ringing note seems to last forever.");
            print2("You notice a robed figure in front of you....");
            morewait();
            print1("The oracle doffs her cowl. Her eyes glitter with blue fire!");
            print2("Attack her? [yn] ");
            if (ynq2() == 'y') {
                setgamestatus(ATTACKED_ORACLE);
                print1("The oracle deftly avoids your attack.");
                print2("She sneers at you and vanishes.");
            }
            else {
                print2("She stares at you...and speaks:");
                if (!gamestatusp(SPOKE_TO_DRUID)) {
                    print3("'The ArchDruid speaks wisdom in his forest shrine.'");
                }
                else if (!gamestatusp(COMPLETED_CAVES)) {
                    print3("'Thou mayest find aught of interest in the caves to the South.'");
                }
                else if (!gamestatusp(COMPLETED_SEWERS)) {
                    print3("'Turn thy attention to the abyssal depths of the city.'");
                }
                else if (!gamestatusp(COMPLETED_CASTLE)) {
                    print3("'Explorest thou the depths of the Castle of the ArchMage.'");
                }
                else if (!gamestatusp(COMPLETED_ASTRAL)) {
                    morewait();
                    print1("'Journey to the Astral Plane and meet the Gods' servants.'");
                    print2("The oracle holds out her hand. Do you take it? [yn] ");
                    if (ynq2()=='y') {
                        print1("'Beware: Only the Star Gem can escape the Astral Plane.'");
                        print2("A magic portal opens behind the oracle. She leads you");
                        morewait();
                        print1("through a sequence of special effects that would have");
                        print2("IL&M technicians cursing in awe and deposits you in an");
                        morewait();
                        clearmsg();
                        print1("odd looking room whose walls seem strangely insubstantial.");
                        gain_experience(5000);
                        change_environment(E_ASTRAL);
                    }
                    else print3("You detect the hint of a sneer from the oracle.");
                }
                else if (!gamestatusp(COMPLETED_VOLCANO)) {
                    print3("'The infernal maw may yield its secrets to thee now.'");
                }
                else if (!gamestatusp(COMPLETED_CHALLENGE)) {
                    print3("'The challenge of adepthood yet awaits thee.'");
                }
                else {
                    morewait();
                    print1("'My lord: Thou hast surpassed my tutelage forever.");
                    print2("Fare thee well.'");
                    print3("The oracle replaces her hood and seems to fade away....");
                }
            }
        }
        else if (response == 'm') {
            print1("You seem to see yourself. Odd....");
            knowledge(1);
        }
        else print2("You leave this immanent place.");
    }
}